谁能告诉我,在vb里加一个公式怎么弄?例如:aa *bb=cc 如果输入aa和bb,自动生成cc 该怎么弄呢?求高手指_百度知道
提问者采纳
在&文本框改变时&的事件里 写代码就可以了假设是 text1,text2,text3Private Sub Text1_Change()
text3.text = val(text1.text) * val(text2.text)End SubPrivate Sub Text2_Change()
text3.text = val(text1.text) * val(text2.text)End Sub这样当text1或text2 文本改变时 text3就自动得出乘积来了
提问者评价
其他类似问题
按默认排序
其他1条回答
Private Sub Text1_Change()
If Val(Text1.Text) & 10 Or Val(Text1.Text) & 0 Then
MsgBox (&请重新输入,0~10间数字&)
Text1.Text = &&
End IfEnd SubPrivate Sub Text2_Change()If Val(Text2.Text) & 10 Or Val(Text2.Text) & 0 Then
MsgBox (&请重新输入,,0~10间数字&)
Text2.Text = &&
End IfEnd SubPrivate Sub Command1_Click()
If Val(Text3.Text) = Val(Text1.Text) * Val(Text2.Text) Then
MsgBox (&恭喜你,答案正确!&)
MsgBox (&答案有误,请重新输入。&)
Text3.Text = &&
End IfEnd Sub
自动生成的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}