Jump to content

Popup menu aligment


d.bernaert

Recommended Posts

Hello,

I have a button and in the onclick event I show a popup menu with the following code:

PopupMenuMore.Popup(0, 36, Sender);

This shows the popup menu aligned to the left side of the button.

I would like to align it to the right side of the button. Therefore I would need to have the width of the pop-up.

Is that possible?

Thx,

Dominique

Link to comment
Share on other sites

4 hours ago, d.bernaert said:

I would like to align it to the right side of the button. Therefore I would need to have the width of the pop-up.

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  PopupMenuMore.Popup((Sender as TUniButton).Width, 36, Sender);
end;

 

Link to comment
Share on other sites

Hi Sherzod,

thx, but that's not what I am looking for.

I want the right of the popup to align with the right of the button.

This is the actual situation (screenshot), but I would like the right of the pop-up to align with the right of the button, so if the text of one of the pop-up menu items is large, it should expand to the left.

Thx,

Dominique

Screenshot.PNG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...