- Home
·
- Graphics
·
- Change color of form by clicking an option. Very basic and could be upgraded but a good example of
Change color of form by clicking an option. Very basic and could be upgraded but a good example of
Change color of form by clicking an option. Very basic and could be upgraded but a good example of the RGB function and passing the index of a
Rate Change color of form by clicking an option. Very basic and could be upgraded but a good example of
(1(1 Vote))
'the control array to begin using the index which is passed to the
'chooseColor function. Then paste the following code into the Code Window.
Private Function chooseColor(ByVal intIndex As Integer)
Dim RED, GREEN, BLUE, YELLOW, I, RGBValue
RED = RGB(255, 0, 0) ' Return the value for Red.
GREEN = RGB(0, 255, 0)
BLUE = RGB(0, 0, 255)
YELLOW = RGB(255, 255, 0)
Select Case intIndex
Case 0
Me.BackColor = RED
Option1(0).BackColor = RED
Option1(1).BackColor = RED
Option1(2).BackColor = RED
Option1(0).ForeColor = YELLOW
Case 1
Me.BackColor = GREEN
Option1(0).BackColor = GREEN
Option1(1).BackColor = GREEN
Option1(2).BackColor = GREEN
Option1(1).ForeColor = YELLOW
Case 2
Me.BackColor = BLUE
Option1(0).BackColor = BLUE
Option1(1).BackColor = BLUE
Option1(2).BackColor = BLUE
Option1(2).ForeColor = YELLOW
End Select
End Function
Private Sub Option1_Click(Index As Integer)
chooseColor (Index)
End Sub
Change color of form by clicking an option. Very basic and could be upgraded but a good example of Comments
No comments yet — be the first to post one!
Post a Comment