I'm using a sButton paired with a dropdown menu and I'd like to have the latter automatically open when I press the button. The button's style is set to bsSplitButton. At the moment, I can only reveal the associated popup menu by clicking the small arrow on the right side. What I'd like to know is how to make the menu open when I press it. I browsed through the button's procedures, but no avail.
procedure TForm1.sButton1Click(Sender: TObject);
var
p : TPoint;
begin
p := sButton1.ClientToScreen(Point(0, 0));
PopupMenu1.Popup(p.X, p.Y + sButton1.Height);
end;
Hey, thank you SO MUCH. It worked like a charm. Great trick.
Kind regards,
Twobit.
'Support' wrote:
Hello
I think, you can use this code :
Code:
procedure TForm1.sButton1Click(Sender: TObject);
var
p : TPoint;
begin
p := sButton1.ClientToScreen(Point(0, 0));
PopupMenu1.Popup(p.X, p.Y + sButton1.Height);
end;