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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form as a menu...

Status
Not open for further replies.

Neil Toulouse

Programmer
Mar 18, 2002
882
GB
Hi Guys!

I have been busy putting a new interface on one of our products, and to spice things up a bit I have used a form to create a fancy-ish menu, and have thus coded it to have some menu behaviour.

I have achieved all I need it to do except close it down! Basically, all I am trying to achieve is if the mouse pointer moves off this menu form, the form closes.

So for this I have some code in the MOUSEMOVE to check mouse co-ords in relation to the dimensions of the form, and to close it if the pointer reaches within 2 px of any of the edges. I have bound all mousemove events of all the objects on the form to the form's mousemove event.

What I am getting is if you move the mouse farily slowly, the code works fine and the form closes.

If, however, you move the mouse quickly (and by quickly here I mean a 'normal' speed that you would move the mouse!!) you can jump out of the form without the form closing. To then get it to close, you have to move back onto the form and move slowly off!!

Is there a way I can overcome this?

TIA
Neil

I like work. It fascinates me. I can sit and look at it for hours...
 

Neil,

Sorry I can't answer your question .... except to say: are you sure you want the menu to close when the mouse leaves it? If you look at other applications that have a form-as-menu interface, the user actually has to click in order to close the form. They can click anywhere on the screen -- not necessarily in your application -- but they do have to click.

For example, I'm just looking at the Recent Documents menu in Office 2007, which I think is the interface you are aiming for. This menu doesn't close just by moving the mouse out of it.

If I've misunderstood what you are trying to achieve, my apologies.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Haven't looked... but does the form have a "MouseOver" event? If it does, as soon as it is not over, you could close the form??? Is that too easy?
-S

Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Hi Neil,

put everything in the form in a container the size of the form and use the containers MouseLeave event.

Bye, Olaf.
 
Thank you all for your suggestions! I will have a play over the next few days and report back what I did!

Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top