过去几天我正在学习这个编程,我很难从TextBox传输数据并将该值放入另一个TextBox的公式中。以下是一个例子:
Private Sub TextBox7_Change()
i = TextBox7
ii = i / 100
End Sub
我需要将ii中的值替换为..
Private Sub TextBox12_Change()
TextBox12 = (d * 1000) / (e * 1000 * c * ff * ii)
End Sub
答案 0 :(得分:0)
按如下所示更改TextBox7_Change()
事件,将其文本值转换为整数。
Private Sub TextBox7_Change()
i = Integer.Parse(TextBox7.Text)
ii = i / 100
End Sub
答案 1 :(得分:0)
公共类FIND_WINDOW_AND_BUTTON
'-----------GLOBAL VARIABLE--------------
Dim i As Integer = 0
Dim ii As Integer = 0
Dim d As Double = 5.2
Dim A As Double = 3.1
Dim c As Double = 1.2
Dim ff As Double = 9.6
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
i = TextBox1.Text
ii = i / 100
TextBox2.Text = (d * 1000) / (A * 1000 * c * ff * ii)
End Sub
结束班
你是说这个意思吗?您可以在一个事件中传输数据而无需调用另一个数据。