Position cursor to left bottom of control (1 Viewer)

pottera

Registered User.
Local time
Today, 19:56
Joined
Sep 3, 2002
Messages
236
Hi, Hoping for a bit of help - there is a lot of info about cursor positioning on the net and I have played with it for ages without success.

I recently found a neat little module which allows you to duplicate a right click & bring up pop up menu ( say by left clicking on a field). I find this very good for creating a nice little menu system in which I can reproduce the nice features of Access menus (I'm using Access 2002) but with a lot more flexibility.

So, I have a line of labels across the top of the form which are my top level menu items - when I click or mouse over these I want to have the pop up menu appear directly under the label. I can position the pop up menu manually by SetCursorPos(x,Y) but as my forms are Pop Up and can move this has proved to be a pain.

What I am after is something that will allow me to work out the coordinates of the left bottom of the label and then position the cursor there then drop the menu. The difficulty I'm having is converting or understanding the position of the label (me.label1.left etc) and relating that to what SetCursorPos needs.

I hope this makes some sense and thanks in anticipation.

Peter
 

Ranman256

Well-known member
Local time
Today, 05:56
Joined
Apr 9, 2015
Messages
4,337
I think this is making too much work for no reason.
Esp, when a user can just click the mouse anywhere they want.
 

vbaInet

AWF VIP
Local time
Today, 10:56
Joined
Jan 22, 2010
Messages
26,374
I'm not a laptop at the moment but if I remember correctly certain controls have a Context menu property where you specify the name of a context/pop up menu to allocate to the control. Access handles the rest.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:56
Joined
May 7, 2009
Messages
19,234
Another alternative would be not to use pop up menu but instead hidden controls that you can make visible when you hover to your menu.
 

pottera

Registered User.
Local time
Today, 19:56
Joined
Sep 3, 2002
Messages
236
Thanks for your replies.
It this the context sensitive popup menus that i am using - i want to be able to have these pop up at a specified location instead of under where the cursor is. Nearly there - i believe I know the answer and will chase up after a sleep.

Again. thanks for your time and input.

Peter
 

Users who are viewing this thread

Top Bottom