Hi,
I'm new to
VB programming but used to program in Basic many years ago. My first attempt in
VB 2005 is to create a form with Radio buttons on it which change the color of the Form when pressed. One of the Buttons is supposed to respond with a random color (well, one of 21 predefined ones!). I can't work out how to change the BackColor property with a single statement. All I can manage to do is have a Select Case structure with the 21 options predefined and choose which one to execute based on a random number like this --
Select Case objRandom.Next(0, 20)
Case 0
frmMainForm.BackColor = Color.Aquamarine
strColourName = " Aquamarine"
Case 1
frmMainForm.BackColor = Color.Beige
strColourName = " Beige"
and so on down to .............
Case 20
frmMainForm.BackColor = Color.Transparent
strColourName = " Transparent"
End Select
Is there a way of replacing the "Color.whatever" with a strVariable? Then I could replace the whole thing with one or two statements.
Thanks for any help.