Luciano França Posted February 9, 2023 Share Posted February 9, 2023 I have this code using the onclick event of a "TuniButton" I don't want to use "TUniMenuButton" procedure P_OnPopupMenuBtnClick(Sender: TObject; PopupMenu: TPopupMenu); begin with TControl(Sender).ClientToScreen(Point(TControl(Sender).Width, TControl(Sender).Height)) do PopupMenu.Popup(x, y); end; procedure TMainForm.UniButton1Click(Sender: TObject); begin P_OnPopupMenuBtnClick(Sender, UniPopupMenu1); end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 10, 2023 Share Posted February 10, 2023 Hello, 9 hours ago, Luciano França said: ClientToScreen You can't use ClientToScreen. 9 hours ago, Luciano França said: I have this code using the onclick event of a "TuniButton" I don't want to use "TUniMenuButton" Could you please explain in more detail what you wanted !? Quote Link to comment Share on other sites More sharing options...
Andy23 Posted February 10, 2023 Share Posted February 10, 2023 Maybe just a Hint: I have created a Free TUniForm and using it as PopUp. The advantage is you are free of designing the content. Then you can set the position of the form by setting TUniForm.Left and TUniForm.Top. It works for me very well. Quote Link to comment Share on other sites More sharing options...
Luciano França Posted February 10, 2023 Author Share Posted February 10, 2023 Just now, Sherzod said: Hello, You can't use ClientToScreen. Could you please explain in more detail what you wanted !? This is just an example I use with VCL I want something similar with Unigui in several situations I need to know the position of where I clicked with the mouse Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.