• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

Disable Double Click on a menu

In VB3 I have tried to disable a doubleclick on a menu because this menu option is the "Finish" option and as such it unloads the form,  however the the "2nd click" of the double click causes the form to be reloaded.

I have tried to disable the "2nd click" by
1) Immediately disabling the form in the click event
2) Setting up a static variable that exits the sub if the   variable has already set (which it is the first time the    event is entered)
3) used the API command GetInputStatus% & if this is true I have exited the routine without doing any processing at all in the hope that the second click will process the code instead - however the GetInputStatus% returns a false and so this option was not able to be used.

Any Ideas?  Do you even understand the question?
0
shek121398
Asked:
shek121398
1 Solution
 
shek121398Author Commented:
Edited text of question
0
 
trilloCommented:
I read, and read again the questions, but I don't get it... If I understand well, you want to disable a double click on a menu... but Menus can't have a double click event........ ???

Trillo
0
 
MattiCommented:
Hi!

Declare an integer Variable on global /form level

Set this variable Clicked = false when form loads

but a these lines first in that Click event

Sub AMenu_Click ()
If Clicked = True Then exit sub
Clicked = True

Then put here what you want to do whit the event.
Note! if it is a function call do not use CALL use X% = style because Call does these independently, it don't wait the function be finnish

'Set this variable back again
Clicked = False

End sub


Matti

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
shek121398Author Commented:
Matti - sorry this code already exists in the click event.  The problem is that the form is unloaded within this event, and even though the 2nd click of the double click is dumped out of the routine with the exit sub - it's too late because the 2nd click has caused the form to be re-loaded.

I'd like to know of a way (within the click event) of determining if the mouse was really double clicked OR a way of removing all other keystrokes and clicks waiting to be processed on that form.
0
 
shek121398Author Commented:
Trillo,
Even though a menu doesn't have a double click event - that doesn't stop the user from double clicking does it?  Instead 2 clicks are processed.  If menus had a double click event then life would be easy for me!
0
 
trilloCommented:
When the user doubleclicks on a control, windows checks if both clicks are within the doubleclick time interval, and if both clicks are within a rectangular area. If so, the Windows interprets it as a double click, otherwise Windows interprets it as two signle mouse clicks..... This means that if the user doubleclicks on a control, the "clcik" event wont' never be fired... This is true for all controls, because every control is a Window, and all windows can recieve single and double clicks. Altough, this is not true for menus, because a menu is one of the few "controls" that is not a window. For menus you can only have a click event...
I'm sorry but I still don't understand some things.... Maybe I'm a little bit idiot:
1) why should the user doubleclick on a menu command... I mean, that's not a standard way of using menus ??
2) If, with the first click, the form is unloaded, Why does it reload on the second click ???

Trillo
0
 
chabaudCommented:
why just try this ?

Sub mnuFinish_Click ()
   End    'terminate the application
end sub

0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now