T
tommaso.gastaldi
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 ButtonTestCondition_SR As Boolean
Private Sub ButtonTestCondition_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ButtonTestCondition.Click
If Me.ButtonTestCondition_SR Then Exit Sub
Me.ButtonTestCondition_SR = True
Me.ExecuteTask()
Me.ButtonTestCondition_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 ButtonTestCondition_SR As Boolean
Private Sub ButtonTestCondition_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ButtonTestCondition.Click
If Me.ButtonTestCondition_SR Then Exit Sub
Me.ButtonTestCondition_SR = True
Me.ExecuteTask()
Me.ButtonTestCondition_SR = False
End Sub
----------------