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!

close a popupmenu when click on desktop

Status
Not open for further replies.

Horrid

Programmer
May 20, 1999
373
0
0
I have a pop up menu that comes up then the user clicks a system tray icon, if I then click on the VB application it vanishes, if I click on the desktop however, it stays and wont go away till I click on the VB app.

And ideas on how to close it when they click on the desktop or another app?
 
I'm not certain if this is of any help but did you look into Form_LostFocus?

I only have VB4, so if this helps, please let me know by clicking on the wording below my siginature line.

Good luck,
--MiggyD "The world shrinks more and more with every new user online."
 
thanks, but no go :(
the problem seems to be that mnuName.visible = false doesn't work, tried enabled as well, nothing.

Is there a command like popupmenu name goaway?
 
Not knowing very much about windows API, I think your problem lies in the fact that the system tray icon and your form is part of the same application, while any other object on your desktop isn't (including the desktop itself).

What you can do about it I can't say straight off, but I think that you will have to use the Windows API to try and catch the event where the program loses focus, then send it a message back to remove the menu.

How to do this, and indeed if it is possible, I can't say.

Good Luck
-Mats
 
the sytem tray you are talking ..is it the part of your application ,,... i mean are u dealing with it in v.b ?
reply soon then i will communicate and write your code snippet so that we can correct
srusti
 
Horrid:

srusti's right! What tray are you taking about?? The system tray is the taskbar.

A popup menu on the VB App is an "application menu" and not a "pop up menu that comes up then the user clicks a system tray icon". Try not to confuse the two (Application Menu & System Tray Menu) they are very different.

and just like srusti said: if you can give us some of the code to look at, we'll all try to help you as best as we may. Don't forget to tell us what version of VB you're using.

--MiggyD "The world shrinks more and more with every new user online."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top