Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popupmenu function

Status
Not open for further replies.

SYTEK

Programmer
Apr 26, 2002
17
0
0
GB
I have a systray program running with popupmenus on the mouse buttons 1 and 2. If click on my app the menu appears but if I then (and here is the problem) click outside of the popup the popup does not disappear.
 
I'm betting you are using NT4 - it is unfortunatley a 'feature'
 
Probably. The issue is the way that VB's implementation of popup menus interacts with NT. I'd guess that the problem would very likely remain under XP Pro.
 
It's looking for an entry. When you make a Pop-Up in VB it acts like a message box, it's won't go away until you choose something. There are 1 of 2 things you could do/try.

1) Cancel Item
You could make an item on your menu called Cancel. You don't even need to put code in it. Just have a menu item that says Cancel, they choose it the menu goes away.

2) Try something with mouse move
See if the Pop-Up menu will react / respond to mouse move events. Or try to get the Twips of the Pop-Up when it pops up. The as soon as the mouse is up, set a timer control to check where the mouse is, if the mouse is not on the menu then set another timer, if the mouse doesn't return to the menu within 3 seconds on the second timer then close the menu...

I'm going to try the 2nd one, if it works I'll let you know. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Thank you for your efforts, I anticipated the second answer if the answer had not been a standard one.

I am seriously struggling with it though
 
I too am having the same problem, but in Microsoft Windows 98 using Visual Basic 6.0 Pro.

I've looked right through the list of events, but have found none that could be used to solve the problem.

I'm using a data bound grid control with a popup menu that appears when you right click on a row. But then I want the menu to disappear and another appear wherever the user clicks with the right mouse button. I notice you can do that in Internet Explorer and mostly every other program, but HOW?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top