AFAIK this is generally done by setting the Enabled property to false so
that the button is grayed.
--
Patrice
<tommaso.gastaldi@uniroma1.it> a écrit dans le message de news:
1146060262.225987.50030@i40g2000cwc.googlegroups.c om...[color=blue]
> 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
>
> ----------------
>[/color]