滚动条视觉基本属性

时间:2016-09-20 23:14:58

标签: vb.net

我使用滚动条处理项目。每个滚动条最大值为255(颜色代码)1滚动条为红色,第二个绿色为第三蓝色。当我将大值属性从1更改为5(项目中需要)并将滚动条一直滑动到结尾时,最终值为251而不是255,并且必须为255.小更改设置为1我目前正在学习vb,有谁知道如何解决这个问题?  这是我的代码,我们不允许使用变量 必须使用显式选项以及严格选项。

选项明确开启 Option Strict On

公共类frmMixer

Private Sub cmdExit_Click(sender As Object, e As EventArgs) Handles cmdExit.Click
    Application.Exit()

End Sub

Private Sub hsbRed_ValueChanged(sender As Object, e As EventArgs) Handles hsbRed.ValueChanged
    lblRed.Text = Convert.ToString(hsbRed.Value)
    picColor.BackColor = Color.FromArgb(hsbRed.Value, hsbGreen.Value, hsbBlue.Value)
End Sub
Private Sub hsbGreen_ValueChanged(sender As Object, e As EventArgs) Handles hsbGreen.ValueChanged
    lblGreen.Text = Convert.ToString(hsbGreen.Value)
    picColor.BackColor = Color.FromArgb(hsbGreen.Value, hsbGreen.Value, hsbBlue.Value)
End Sub

Private Sub hsbBlue_ValueChanged(sender As Object, e As EventArgs) Handles hsbBlue.ValueChanged
    lblBlue.Text = Convert.ToString(hsbBlue.Value)
    picColor.BackColor = Color.FromArgb(hsbRed.Value, hsbGreen.Value, hsbBlue.Value)
End Sub

结束班

0 个答案:

没有答案