Solved

Disable Double Click on a menu

Posted on 1998-12-20
7
241 Views
Last Modified: 2010-05-03
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
Comment
Question by:shek121398
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Author Comment

by:shek121398
ID: 1451678
Edited text of question
0
 
LVL 2

Expert Comment

by:trillo
ID: 1451679
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
 
LVL 14

Expert Comment

by:Matti
ID: 1451680
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:shek121398
ID: 1451681
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
 

Author Comment

by:shek121398
ID: 1451682
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
 
LVL 2

Expert Comment

by:trillo
ID: 1451683
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
 
LVL 4

Accepted Solution

by:
chabaud earned 100 total points
ID: 1451684
why just try this ?

Sub mnuFinish_Click ()
   End    'terminate the application
end sub

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question