在VB 中有两个文本框,怎么实现:当两个文本框的内容都改变时才能触发一个事件?
展开全部
Private Sub Text1_Change()
Text1.Tag = "1"
If Text2.Tag = "1" Then
Text2.Tag = ""
MsgBox "两个文毕空悉本亏拆框的内容都改变了"
End If
End Sub
Private Sub Text2_Change()
Text2.Tag = "1"
If Text1.Tag = "1" Then
Text1.Tag = ""
MsgBox "两个文本框手乎的内容都改变了"
End If
End Sub
Text1.Tag = "1"
If Text2.Tag = "1" Then
Text2.Tag = ""
MsgBox "两个文毕空悉本亏拆框的内容都改变了"
End If
End Sub
Private Sub Text2_Change()
Text2.Tag = "1"
If Text1.Tag = "1" Then
Text1.Tag = ""
MsgBox "两个文本框手乎的内容都改变了"
End If
End Sub
展开全部
Dim isAllChange As Boolean
Private Sub Form_Load()
isAllChange = False
End Sub
Private Sub Text1_Change()
If isAllChange = False Then
isAllChange = True
Else
myFun
isAllChange = False
End If
End Sub
Private Sub Text2_Change()
If isAllChange = False Then
isAllChange = True
Else
myFun
isAllChange = False
End If
End Sub
Private Sub myFun()
MsgBox "我的州培衡中帆事册做件"
End Sub
Private Sub Form_Load()
isAllChange = False
End Sub
Private Sub Text1_Change()
If isAllChange = False Then
isAllChange = True
Else
myFun
isAllChange = False
End If
End Sub
Private Sub Text2_Change()
If isAllChange = False Then
isAllChange = True
Else
myFun
isAllChange = False
End If
End Sub
Private Sub myFun()
MsgBox "我的州培衡中帆事册做件"
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询