|
-
Nov 25th, 2000, 03:15 AM
#1
Is there a way to prevent click events from initiating while a previous event is being processed?
ie.
I have a form with many command buttons, and when I click one of them, I want to ignore any other click on other objects until the routine from the first click terminates.
It happens that I have a comm port trans, and the user clicks on objects while the system is handling an interrupt routine. I would like to be able to ignore new events, and perhaps inform the user that the system is busy.
Please, any info?
NV
-
Nov 25th, 2000, 03:23 AM
#2
Fanatic Member
DoEvents
Add DoEvents as the first line in each click statement....
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Nov 25th, 2000, 03:47 AM
#3
Thanks for the info,
I will use DoEvent an other part of my program, but I don't think I explained my situation accurately.
Sometimes when you have many buttons on a form and you press a bunch of them in sequence, you want to IGNORE the ones that were pressed. This prevents unintentional clicks when the system is busy.
Hope you can help,
NV
-
Nov 25th, 2000, 03:56 AM
#4
Fanatic Member
You could always disable the other buttons until the one running is completed.
i.e.
Code:
Private Sub Command1_Click()
Command2.Enabled = False
Command3.Enabled = False
'.......CODE HERE..........
Command2.Enabled = True
Command3.Enabled = True
End Sub
Private Sub Command2_Click()
Command1.Enabled = False
Command3.Enabled = False
'.......CODE HERE..........
Command1.Enabled = True
Command3.Enabled = True
End Sub
'ETC
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Nov 25th, 2000, 08:19 AM
#5
Addicted Member
a quick fix might be
"form1.enabled = false"
-
Nov 25th, 2000, 03:53 PM
#6
New Member
why don't you try declaring a global Boolean}
Variable and when you start the sub set it to False
an d in the first line of the other subs
put somthing like this
'Global Variable Control
Dim DoClik as Boolean
If DoClik = False then Exit Sub
'The rest of your Code...
-
Nov 25th, 2000, 03:55 PM
#7
New Member
Oops
I Forgot when you Finish your Process
Set the Variable to True!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|