Hi guys,

I'm pretty new to VB and am having a little bit of trouble with scroll bars.
I have a text box and I want the user to input a value in there but I also want them to increase the value through a scroll bar or decrease the value with a scroll bar.
Not so much a scroll bar but just arrows pointing upwards and downwards to increase decrease.
How would I do this?

Jem00

Hi,
Scroll Bars having Min, Max, LargeChange, SmallChange and Value properties
Min Represents scrollbar position's minimum Value.(top or leftmost position)
Max Represents scrollbar position's Maximum Value. (bottom or rightmost position)
LargeChange amount of change to the Value property when the user clicks the area between the scroll box and scroll arrow.
SmallChange amount of change to the value property when the user clicks a scroll arrow.
Value current position of the scroll bar always between Max and Min property
Now Example
> Open Standard EXE Project
> In Form1, Draw a Label (Name Label1) and a Vertical Scroll Bar (VScroll1)

Private Sub Form_Load()
   VScroll1.Min = 0
   VScroll1.Max = 100
   VScroll1.LargeChange = 10
   VScroll1.SmallChange = 5
End Sub

Private Sub VScroll1_Change()
   Label1.Caption = VScroll1.Value
End Sub

which one u want to use?
Horizontal scroll bar

Private Sub HScroll1_Change()
Text1.Text = HScroll1.Value
End Sub

Vertical scroll bar

Private Sub VScroll1_Change()
Text1.Text = VScroll1.Value
End Sub

Thanks you guys solved my problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.