设计一个VB程序,如下图所示。使用三个滚动条作为三种基本颜色的输入工具,
展开全部
Private Sub Form_Load()
HScroll1.Min = 0: HScroll1.Max = 255
HScroll2.Min = 0: HScroll2.Max = 255
HScroll3.Min = 0: HScroll3.Max = 255
End Sub
Private Sub HScroll1_Change() '红色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll2_Change() '绿色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll3_Change() '蓝色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
'先用上面的代码调试,调试完了,再加入下面的代码,分别看看效果,对你有帮助
Private Sub HScroll1_Scroll() '红色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll2_Scroll() '绿色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll3_Scroll() '蓝色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
HScroll1.Min = 0: HScroll1.Max = 255
HScroll2.Min = 0: HScroll2.Max = 255
HScroll3.Min = 0: HScroll3.Max = 255
End Sub
Private Sub HScroll1_Change() '红色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll2_Change() '绿色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll3_Change() '蓝色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
'先用上面的代码调试,调试完了,再加入下面的代码,分别看看效果,对你有帮助
Private Sub HScroll1_Scroll() '红色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll2_Scroll() '绿色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll3_Scroll() '蓝色
Picture1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询