Sometimes I just want to avoid the User might click again on a button
(or other control) before the tasks attached to the click event are
over (to avoid that he may unwillingly re-run them).
So far, I have been using a kind of "Red Semaphore" (_SR) boolean flag
to do that, but actually I feel that my solution is quite awkward. Does
anybody has a more elegant way to propose?
-Tom
-------------
Private ButtonTestCondi tion_SR As Boolean
Private Sub ButtonTestCondi tion_Click(ByVa l sender As
System.Object, ByVal e As System.EventArg s) Handles
ButtonTestCondi tion.Click
If Me.ButtonTestCo ndition_SR Then Exit Sub
Me.ButtonTestCo ndition_SR = True
Me.ExecuteTask( )
Me.ButtonTestCo ndition_SR = False
End Sub
----------------
(or other control) before the tasks attached to the click event are
over (to avoid that he may unwillingly re-run them).
So far, I have been using a kind of "Red Semaphore" (_SR) boolean flag
to do that, but actually I feel that my solution is quite awkward. Does
anybody has a more elegant way to propose?
-Tom
-------------
Private ButtonTestCondi tion_SR As Boolean
Private Sub ButtonTestCondi tion_Click(ByVa l sender As
System.Object, ByVal e As System.EventArg s) Handles
ButtonTestCondi tion.Click
If Me.ButtonTestCo ndition_SR Then Exit Sub
Me.ButtonTestCo ndition_SR = True
Me.ExecuteTask( )
Me.ButtonTestCo ndition_SR = False
End Sub
----------------
Comment