|
-
Sep 19th, 2002, 10:24 AM
#1
Thread Starter
Member
Changing backcolor on a form
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|