Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
(Thank you Noogle, and Seth for helping me with my array problem!!! )
Does anybody know how to code for a vertical scroll bar, so that when you click the down arrow once a exam question from a file will appear and there is 5 exam questions, so you click the down arrow on the scroll bar each time and a new question appears each click. I have tried so hard to get this to work and have been unsuccessful. If anybody knows any site that could help me or knows anything about scroll bars in Visual Basic talk to me please. My code so far, which is for loading the questions into the vertical scroll but I am stuck!! If you could add something to my code, copy and paste it to show me. HELP ME PLEASE!!!!!!!
Dim Question As String
Dim answer1 As String
Dim answer2 As String
Dim answer3 As String
Dim answer4 As String
Dim Index As Integer
Dim exam As Integer
`
Do While Not EOF(1)
Input #1, Question, answer1, answer2, answer3, answer4
lblQuestion.Caption = Question
lblanswer1.Caption = answer1
lblanswer2.Caption = answer2
lblanswer3.Caption = answer3
lblanswer4.Caption = answer4
LoopClose #1

You want to set the scrollbar largechange smallchange properties and the min and max properties (look on the Microsoft MSDN site for details - very good resource) to what you need and read from the scrollbar value property when the change event fires. Read the relevant question from the file depending on the scrollbar value i.e. value = 0 question = 1 (values generally start from 0 in VB)
You would be well served to look through Microsoft site for MSDN, it contains info on all properties and events for common controls giving examples of usage and related topics
Hope this helped

Which control with scrollbar are you using?
Combobox, listbox, lisview, dbgrid, msflexgrid, text... some other?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |