Jump to content
HeartWare

PopUp Sub-Menu Location

Recommended Posts

Is it possible to control the location of a Sub-Menu off a TPopupMenu? Ie. A TPopupMenu has an item that is a sub-menu with items. I want to control where this sub-menu pops up (normally, it pops up to the right, but I want it to pop up on the left due to screen design).

 

Or is it possible to not have the sub-menu being auto-opened with mouse hover over the sub-menu item (ie. you have to click the sub-menu item in order to open the entire sub menu)?

Share this post


Link to post
23 hours ago, HeartWare said:

Is it possible to control the location of a Sub-Menu off a TPopupMenu? Ie. A TPopupMenu has an item that is a sub-menu with items. I want to control where this sub-menu pops up (normally, it pops up to the right, but I want it to pop up on the left due to screen design).

 

Or is it possible to not have the sub-menu being auto-opened with mouse hover over the sub-menu item (ie. you have to click the sub-menu item in order to open the entire sub menu)?

The position of the submenus is controlled by Windows (assuming we are talking about a VCL app), by default it pops up on the right side, unless there is insufficient space available on the screen on that side. I don't know of a way to control that.

What you could do is to implement each submenu as a separate TPopupMenu and pop it up manually from the OnClick event of the "parent" menu item. Unfortunately it is not trivial to determine the screen position of an open menu item...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×