关于vb文本框相加问题

dqlh1122 2005-11-18 11:52:48
比如说:文本1+文本2+文本3=文本4中文本1中输入1,文本4中就应该显示结果1,文本2中输入2时文本4中就应该显示结果3,依次推算.
...全文
211 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
weiweiplay 2005-11-18
  • 打赏
  • 举报
回复
Private Sub Text1_Change()
If IsNumeric(Text1) Then
Text4.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)
End If
End Sub
Private Sub Text2_Change()
If IsNumeric(Text2) Then
Text4.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)
End If
End Sub

Private Sub Text3_Change()
If IsNumeric(Text3) Then
Text4.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)
End If
End Sub
daisy8675 2005-11-18
  • 打赏
  • 举报
回复
Option Explicit

Private Sub Text1_Change()
Text4.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)
End Sub
Private Sub Text2_Change()
Text4.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)
End Sub

Private Sub Text3_Change()
Text4.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)
End Sub

吐血一下

1,453

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧