Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Mar 8, 2002

Use the ScrollBar Instead of UpDown or Spin Controls


If you want the user to be able to select from a fixed range of numeric values, you have a number of choices. In VB6, you can use the UpDown control, part of Common Controls 2 (630K), or the Spin control, part of the Forms 2.0 Object Library (more than 1 MB and not redistributable). Instead of either of these controls, you can use a standard vertical ScrollBar to provide the same functionality in any VB version from VB3 through VB6, without any additional baggage in your installation. Place a TextBox (Text1) and a vertical ScrollBar (VScroll1) on the form, with the ScrollBar touching the right edge of the TextBox. Make sure that the ScrollBar is the same height as the TextBox, and that the thumb is not visible. You do not want the user to be able to change the TextBox value by entering a new value directly, so you should set the TextBox Locked property to True. You need to make the ScrollBar work the same way the other controls do
Eric Schuyler
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date