Stap 2: Code!
Dubbel klik de volgbalk. 2 lijnen van code moeten opduiken. Zoiets als:
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll End Sub
Nu leren we over waarden. Op deze volgbalk krijgen we alleen 11 waarden, 0-10. Waarde 0 is helemaal links terwijl de waarde 10 is het zeer juist. Heb je dat? Laat gaan.
Leven gemakkelijker te maken alle tekst in deze stap van nu af aan is gonna be code-stijl
In between the two lines of code type in:If TrackBar1.Value = placceavaluenumberhere ThenEnd Ifreplacing placeavaluenumberhere with the value number of the place where you want it to be. Now in between those 4 lines of code type what you want to do. In this case:TextBox1.BackColor = Color.BlackOnce you're done that repeat for each place. When I was done it looked like this:Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll If TrackBar1.Value = 0 Then TextBox1.BackColor = Color.Black End If If TrackBar1.Value = 1 Then TextBox1.BackColor = Color.White End If If TrackBar1.Value = 2 Then TextBox1.BackColor = Color.Red End If If TrackBar1.Value = 3 Then TextBox1.BackColor = Color.Blue End If If TrackBar1.Value = 4 Then TextBox1.BackColor = Color.Yellow End If If TrackBar1.Value = 5 Then TextBox1.BackColor = Color.Purple End If If TrackBar1.Value = 6 Then TextBox1.BackColor = Color.Green End If If TrackBar1.Value = 7 Then TextBox1.BackColor = Color.Orange End If If TrackBar1.Value = 8 Then TextBox1.BackColor = Color.Brown End If If TrackBar1.Value = 9 Then TextBox1.BackColor = Color.White End If If TrackBar1.Value = 10 Then TextBox1.BackColor = Color.White End If End Sub