|
-
Jun 17th, 2010, 08:54 AM
#1
Thread Starter
Member
[RESOLVED] when click on listbox a button gets colored
hi,
i have the following question:
my code:
Code:
Private Sub lstKleur1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstKleur1.SelectedIndexChanged
Dim Geel As String
Dim Blauw As String
Dim Groen As String
Dim Rood As String
Dim lstKleur1 As String
If lstKleur1 = Rood Then
Kleurknop1.BackColor = Color.Red
End If
If lstKleur1 = Geel Then
Kleurknop1.BackColor = Color.Yellow
End If
If lstKleur1 = Blauw Then
Kleurknop1.BackColor = Color.Blue
End If
If lstKleur1 = Groen Then
Kleurknop1.BackColor = Color.Green
End If
End Sub
okay, i want the following: there are four items in my listbox: Rood, Groen, Geel, Blauw (these are dutch for red, green, yellow, blue). and when i click one of these, the button (Kleurknop1) needs to get the right colour. but when i click it now, it just keeps getting green, no matter which one i click. so how to solve this?
i hope i am clearly enough.
i am using visual basic 2008
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
|