JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Adding Scroll Bars to Text Boxes

Now that you're using multiline text boxes, it would be even better if you could add scroll bars to let the user enter even more text. If your program's users are going to be entering a lot of text into text boxes, you can avoid the need for huge text boxes by adding scroll bars.

Using the ScrollBars property, there are four ways to add scroll bars to a text box; here are the settings you use for ScrollBars, and the type of scroll bars each setting displays:

  • 0: None

  • 1: Horizontal

  • 2: Vertical

  • 3: Both

Note that in order for the scroll bars to actually appear, the text box's MultiLine property must be True. After you install scroll bars in a text box, the result appears as in Figure 5.3. Now the user can enter much more text simply by scrolling appropriately.

Figure 5.3: Using scroll bars in a text box.

Although multiline text boxes can hold up to 32KB characters, that may be too much for you to conveniently handle, and you may want to limit the maximum number of characters a text box can hold. You do that by setting the text box's MaxLength property to the maximum number of characters you want the user to be able to enter.

Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor