stevemelaaron
Sep 19th, 2002, 10:24 AM
I have a form with a trackbar control on it, the minimum value set to 0 and the maximum value set to 15. Each time the user changes the value of the trackbar by moving the slider, I would like to change the background color of the form that it is on to one of the 16 QBColors. In VB6, I was able to accomplish this with the statement
Me.Backcolor = QBColor(Slider1.Value)
However, in VB.NET, the only way that I have been able to accomplish the same effect is through a SELECT....CASE structure
Select Case Trackbar1.Value
Case 0:
Me.Backcolor = System.Drawing.Color.Black
Case 1:
Me.Backcolor = System.Drawing.Color.Blue
Case 2:
Me.Backcolor = System.Drawing.Color.Green
(etc.....)
End Select
Is there another more elegant way to do this without having to use the SELECT...CASE structure in VB.NET?
--Steve K.
Me.Backcolor = QBColor(Slider1.Value)
However, in VB.NET, the only way that I have been able to accomplish the same effect is through a SELECT....CASE structure
Select Case Trackbar1.Value
Case 0:
Me.Backcolor = System.Drawing.Color.Black
Case 1:
Me.Backcolor = System.Drawing.Color.Blue
Case 2:
Me.Backcolor = System.Drawing.Color.Green
(etc.....)
End Select
Is there another more elegant way to do this without having to use the SELECT...CASE structure in VB.NET?
--Steve K.