I mean make a button and then it will randomly select and option for you.
Last edited by ppl2pass; 03-17-2010 at 01:51 PM.
ppl2pass (03-17-2010)
ok thanks. how do you make it select random options but not select a few of the options.
ex.
comboBox1 List:
apples
oranges
pears
random:
selects any option but the oranges.
so only select from pears and apples.
You could put options in an array if you wanted and have the button select an option from the array.
Try this
[php]
Private Sub RandomCombo()
Dim I As New Random
Dim X As Integer = I.Next(0, ComboBox1.Items.Count - 1)
ComboBox1.SelectedIndex = X
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RandomCombo()
End Sub
Private Sub ComboBox1_SelectedItemChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedItem = "APPLES" Then
RandomCombo()
End If
End Sub
[/php]
Essentially create a sub to call random index,
Button press goes to sub
on item change check if it is "Apples" , if so Re roll
note : have not tested, using above theory and basic principles, if not, concept may need modification
Last edited by NextGen1; 03-17-2010 at 03:09 PM.