by David Koopman (11 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 27th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
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
'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
No comments have been posted about Change color of form by clicking an option. Very basic and could be upgraded but a good example of . Why not be the first to post a comment about Change color of form by clicking an option. Very basic and could be upgraded but a good example of .