Public Sub next_Click()
If ValueBox1.Value = ListBox1.count - 1 Then
'nothing more to advance
ValueBox1.Value = 0
listbox1.Index = 0
TextBox2.Text = ListBox1.Current.Text
ValueBox2.Value = lb1count.Value
Else
ListBox1.Index = ValueBox1.value + 1
TextBox2.Text = ListBox1.Current.Text
Wait 0.1
ValueBox1.Value = ListBox1.Index
TextBox2.Text = ListBox1.Current.Text
ValueBox2.Value = lb1count.Value - ValueBox1.Value
fiveahead_Click
Endif
Public Sub fiveahead_Click()
If ValueBox2.value > 5 Then
listbox1.index = ValueBox1.Value + 1
pos1.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 2
pos2.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 3
pos3.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 4
pos4.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 5
pos5.Text = listbox1.Current.Text
'go back to what was requested
listbox1.index = ValueBox1.Value
Endif
If ValueBox2.value = 5 Then
listbox1.index = ValueBox1.Value + 1
pos1.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 2
pos2.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 3
pos3.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 4
pos4.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - listbox1.count
pos5.Text = listbox1.Current.Text
'go back to what was requested
listbox1.index = ValueBox1.Value
Endif
If ValueBox2.value = 4 Then
listbox1.index = ValueBox1.Value + 1
pos1.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 2
pos2.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 3
pos3.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - listbox1.count
pos4.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 1)
pos5.Text = listbox1.Current.Text
'go back to what was requested
listbox1.index = ValueBox1.Value
Endif
If ValueBox2.value = 3 Then
listbox1.index = ValueBox1.Value + 1
pos1.Text = listbox1.Current.Text
listbox1.index = ValueBox1.Value + 2
pos2.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - listbox1.count
pos3.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 1)
pos4.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 2)
pos5.Text = listbox1.Current.Text
'go back to what was requested
listbox1.index = ValueBox1.Value
Endif
If ValueBox2.value = 2 Then
listbox1.index = ValueBox1.Value + 1
pos1.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - listbox1.count
pos2.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 1)
pos3.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 2)
pos4.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 3)
pos5.Text = listbox1.Current.Text
'go back to what was requested
listbox1.index = ValueBox1.Value
Endif
If ValueBox2.value = 1 Then
listbox1.index = lb1count.Value - listbox1.count
pos1.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 1)
pos2.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 2)
pos3.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 3)
pos4.Text = listbox1.Current.Text
listbox1.index = lb1count.Value - (listbox1.count - 4)
pos5.Text = listbox1.Current.Text
'go back to what was requested
listbox1.index = ValueBox1.Value
Endif
end
Here's the Back button:
Public Sub Button4_Click()
If ValueBox1.Value = 0
'nothing more to advance
ValueBox1.Value = lb1count.Value - 1
listbox1.Index = lb1count.Value - 1
TextBox2.Text = ListBox1.Current.Text
Else
ListBox1.Index = ValueBox1.value - 1
TextBox2.Text = ListBox1.Current.Text
Wait 0.1
ValueBox1.Value = ListBox1.Index
Endif
End