vb滚动条控制颜色纯度

如题,如何控制,请告知代码啊,谢谢了先
2024-12-19 20:03:55
推荐回答(1个)
回答1:

用三个横向滚动条和一个文本框:

Private Sub Form_Load()
HScroll1.Min = 0
HScroll1.Max = 255
HScroll1.LargeChange = 10
HScroll2.Min = 0
HScroll2.Max = 255
HScroll2.LargeChange = 10
HScroll3.Min = 0
HScroll3.Max = 255
HScroll3.LargeChange = 10
End Sub

Private Sub HScroll1_Change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub

Private Sub HScroll1_Scroll()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub

Private Sub HScroll2_Change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub

Private Sub HScroll2_Scroll()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub

Private Sub HScroll3_Change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub

Private Sub HScroll3_Scroll()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub