-
I want to stop people who click to much on a button.
I tryed disabling the button in the code so users can't click it. But while it grayed out they can click and when the button becomes able again the click will take effect.
Any ideas?
sample code
Code:
Private Sub cmdstart_Click()
Dim retval As String
Dim hApp As Long
cmdstart.Enabled = False
cmdRUN.Enabled = False
If IsApplicationRunning("c:\poop.exe") Then
CloseApp
sleep 5000
cmdstart.Caption = "Start"
cmdstart.Enabled = True
cmdRUN.Enabled = True
Else
Call cmdRun_Click
sleep 5000
cmdstart.Caption = "Stop"
End If
End Sub
(This button just turns an app on and on).
[Edited by AmmerBow on 09-18-2000 at 03:54 PM]
-
Try this:
Code:
Dim dclicked As Integer
Private Sub Form_Load()
dclicked = 0
End Sub
Private Sub Command1_Click()
dclicked = dclicked + 1
If dclicked = 2 Then
Msgbox "You clicked already! NO MORE!", vbCritical
End If
End Sub