Reputation:
I need to have dropdown menus on TButton, when the button is clicked with the left mouse button.
I use the following code in the button's onClick event:
procedure TForm1.button1Click(Sender: TObject);
var
pt:TPointF;
begin
pt.X:=0;
pt.Y:=button1.Height;
pt:=button1.LocalToAbsolute(pt);
pt:=ClientToScreen(pt);
popupmenu1.Popup(pt.X,pt.y);
end;
This works fine with Windows as target platform, it also works on OSX, but when I click the button fast a couple of times, it crash on OSX (not so on Windows, there's no issue).
What am I doing wrong???
Upvotes: 0
Views: 1489
Reputation:
Must have been a bug in 10.1 Update 2. I just installed Delphi 10.2 Tokyo, and it works.
Upvotes: 1