I agree with James I think this is the easiest and cleanest. I call my boolean varialble "ClickedByUser"Originally posted by James Stanich
VB Code:
' In Declarartion Area Dim BOOLCANCEL as Boolean ' In Click Event of control you want to handle If BOOLCANCEL = FALSE Then ' Perform the click event... ' When setting something you know will fire click event use : BOOLCANCEL = TRUE ' Run your code BOOLCANCEL = FALSE
Does this make sense?
VB Code:
Dim ClickedByUser as boolean Sub Something() 'Call the command1 click event ClickedByUser = False Command1_Click End Sub Sub Command1_Click() 'see if user cliced me or program clicked me If ClickedByUser Then 'user code here Else 'program code here 'reset my variable ClickedByUser = True End if End Sub




Reply With Quote