Visual Basic Tutorial: Using the ScrollBar

Опубликовано: 02 Май 2026
на канале: KRob314to636
13,567
12

This video shows how to use the scrollBar control to change the back color of an object.


*************************************************************************

Sub ColorBox1()
Dim clr As Color
clr = Color.FromArgb(redBar.Value, greenBar.Value, blueBar.Value)
panel2.backcolor = clr
End Sub
*************************************************************************

Sub ColorBox2()
Dim clr As Color
clr = Color.FromArgb(redBar.Value, greenBar.Value, blueBar.Value)
Panel1.BackColor = clr
End Sub

*************************************************************************
Private Sub bluebar_ValueChanged(sender As Object, e As System.EventArgs) Handles bluebar.ValueChanged, greenbar.ValueChanged, redbar.ValueChanged
If RadioButton1.Checked = True Then
ColorBox1()
Else
ColorBox2()
End If
End Sub