Changing button color
Changing button color
(OP)
I need to change backcolor to multiple buttons(ex. 15 buttons) at once. I mean,I dont want to write the code
" button1.backcolor=color.red " 15 times!! Any ideas?
" button1.backcolor=color.red " 15 times!! Any ideas?
RE: Changing button color
Use the controls collection. If all your buttons begin with the same prefix (ex btnbuttonname), then it should be fairly simple to check that the control you have is a button and change the backcolor color.
SA
RE: Changing button color
RE: Changing button color
Buttons are named: Button1, Button2....
For i As Integer = 1 To 15
Me.Controls("Button" & i).BackColor = Color.Blue
Next i
Thanks SolidAir!!
RE: Changing button color
I have not seen it done this way, but as long as it works, its works.
SA