say if my textbox has X item how do i select 1 item from listbox?
Printable View
say if my textbox has X item how do i select 1 item from listbox?
this is a snippet from a project of mine
just change combo1 to list1Code:Dim A As Integer
Dim B As Integer
Dim C As Integer
A = Combo1.ListCount
B = Combo2.ListCount
C = Combo3.ListCount
Dim AX As Integer
Dim AY As Integer
Dim AZ As Integer
AX = Int(Rnd() * A)
AY = Int(Rnd() * B)
AZ = Int(Rnd() * C)
G1 = Combo1.List(AX)
G2 = Combo2.List(AY)
G3 = Combo3.List(AZ)
and take out all the extra stuff
G1 is a textbox by the way.
Should pretty much do it.Code:Dim A as integer
A = rnd * list1.listcount
text1.text = list1.list(A)