请高手帮忙看一下用VB做的非常简单的调色板功能的程序哪里出错了,感谢! 20
PublicClassForm1PrivateSubTextBox1_TextChanged(ByValsenderAsSystem.Object,ByValeAsSys...
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
TextBox2.Text = "数值:" & TrackBar1.Value
TextBox1.BackColor = Color.FromArgb(255, Val(TextBox2.Text), Val(TextBox3.Text), Val(TextBox4.Text))
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
TextBox2.Text = "数值:" & TrackBar1.Value & "比重:" & TrackBar1.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox3.Text = "数值:" & TrackBar2.Value & "比重:" & TrackBar2.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)
End Sub
Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll
TextBox3.Text = TrackBar2.Value
TextBox1.BackColor = Color.FromArgb(255, Val(TextBox2.Text), Val(TextBox3.Text), Val(TextBox4.Text))
End Sub
Private Sub TrackBar3_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar3.Scroll
TextBox4.Text = TrackBar3.Value
TextBox1.BackColor = Color.FromArgb(255, Val(TextBox2.Text), Val(TextBox3.Text), Val(TextBox4.Text))
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
TextBox4.Text = "数值:" & TrackBar3.Value & "比重:" & TrackBar3.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)
End Sub
End Class
这个程序中诸如TextBox4.Text = "数值:" & TrackBar3.Value & "比重:" & TrackBar3.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)这个语句,里面哪里出错误了?调试的时候,这个程序的三个文本框里都是数值显示正常,而比重显示不正常。比如滑动红的滑动条,比重为1,再滑动别的滑动条,红比重不变,只有再重新滑动红的时候才改变比重。这是怎么回事?该怎样改?先谢谢了! 展开
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
TextBox2.Text = "数值:" & TrackBar1.Value
TextBox1.BackColor = Color.FromArgb(255, Val(TextBox2.Text), Val(TextBox3.Text), Val(TextBox4.Text))
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
TextBox2.Text = "数值:" & TrackBar1.Value & "比重:" & TrackBar1.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox3.Text = "数值:" & TrackBar2.Value & "比重:" & TrackBar2.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)
End Sub
Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll
TextBox3.Text = TrackBar2.Value
TextBox1.BackColor = Color.FromArgb(255, Val(TextBox2.Text), Val(TextBox3.Text), Val(TextBox4.Text))
End Sub
Private Sub TrackBar3_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar3.Scroll
TextBox4.Text = TrackBar3.Value
TextBox1.BackColor = Color.FromArgb(255, Val(TextBox2.Text), Val(TextBox3.Text), Val(TextBox4.Text))
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
TextBox4.Text = "数值:" & TrackBar3.Value & "比重:" & TrackBar3.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)
End Sub
End Class
这个程序中诸如TextBox4.Text = "数值:" & TrackBar3.Value & "比重:" & TrackBar3.Value / (TrackBar1.Value + TrackBar2.Value + TrackBar3.Value)这个语句,里面哪里出错误了?调试的时候,这个程序的三个文本框里都是数值显示正常,而比重显示不正常。比如滑动红的滑动条,比重为1,再滑动别的滑动条,红比重不变,只有再重新滑动红的时候才改变比重。这是怎么回事?该怎样改?先谢谢了! 展开
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询