: hello, i am a student just learning VB and the book that my class is using does not have any thing about scrollbars, and i cant get it to work, can someone please explane how to make it work right (either through explanation or throught example). thank you.
:
I'm hardly a VB guru, but I'll try to offer something - for VB anyway... dunno about .Net. If you're using the built in controls, then
VScroll and HScroll both have a max and min property that can be set at run time. For example, if you create a project that has a list box, and a vertical scroll bar for a class of 5 students, and each value of the scroll bar represents a single student that is in the listbox then
Form_Load
Dim i As Integer
For i = 0 To 4
List1.AddItem "Student " & CStr(i + 1)
Next
vscroll1.Min = 0
vscroll1.Max = 4
vscroll1.Value = 0
List1.Selected(vscroll1.Value) = True
------------------
VScroll1_Change
List1.Selected(VScroll1.Value) = True ' choose the desired student
------------------
If you ran that, you *should* see the highlighted item in the list box change in relation to the current value of the scroll bar.