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

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: