'不知道有没有好办法 Option ExplicitPrivate m_blnDBL As BooleanPrivate Sub Text1_DblClick() m_blnDBL = True Form2.Show vbModal End SubPrivate Sub Text1_LostFocus() If m_blnDBL = False Then MsgBox "Text1_LostFocus" End If m_blnDBL = False End Sub
Private Sub DB() MsgBox "DblClick" End SubPrivate Sub Text1_DblClick() DB End SubPrivate Sub Text1_LostFocus() LF End Sub Private Sub LF() MsgBox "LostFocus" End Sub
Option ExplicitPrivate m_blnDBL As BooleanPrivate Sub Text1_DblClick()
m_blnDBL = True
Form2.Show vbModal
End SubPrivate Sub Text1_LostFocus()
If m_blnDBL = False Then
MsgBox "Text1_LostFocus"
End If
m_blnDBL = False
End Sub
=================================
这种事情最好在Validate事件中做
使用Validate事件,完全可以避免你现在的问题
MsgBox "DblClick"
End SubPrivate Sub Text1_DblClick()
DB
End SubPrivate Sub Text1_LostFocus()
LF
End Sub
Private Sub LF()
MsgBox "LostFocus"
End Sub
当双击的时候 ,截取textbox的WM_KILLFOCUSE 消息 它就不会触发 LostFocus 事件了*****************************************************************************
能不能说说,具体怎么做?