Private Sub HScrollBar1_Scroll(ByVal sender As Object, _
开发者_JS百科 ByVal e As ScrollEventArgs) _
Handles HScrollBar1.Scroll
Me.BackColor = HScrollBar1.Value
End Sub
How can I set the BackColor
of the form? How can I use an RGB value?
Me.BackColor = Color.FromArgb(255,255,255)
...replacing the 255 on each parameter with the value you need. e.g.
Me.BackColor = Color.FromArgb(HScrollBar1.Value,HScrollBar2.Value,HScrollBar3.Value)
Use Color.FromArgb()
As stated in the BackColor property documentation, use System.Drawing.Color
You can use formname.backcolor
to set the background color of a form programatically. For example:
formname.backcolor = vbred
For a red form background color.
精彩评论