I have generated a random number between 1 to 9, each number corresponding to each of 9 buttons.
How can I append the random number to a button, like so:
visual basic code: Function generate() As Integer
Dim choose As Integer = Int(Rnd() * 9 + 1)
Button & "choose" & .Text = "text here"
End Function
The Button & "choose" part is incorrect, I know, but it's just to give you a general idea of what I would like to achieve.
Each of my 9 buttons are named from Button1 to Button9.
Any suggestions on how I could do this?




Reply With Quote