According to TMS, W7ToolButton1 can be used for displaying a dropdown menu. But I am failing to see how you can do that as it has no dropdown menu property. Only menu I can add is the popup menu which is not the same as the dropdown one.Someone knows how to add a dropdown menu to the button??? I can add a dropdown arrow to the button but its a mystery on how to make the popup menu show on clicking this arrow (assuming it functions this way) ...

有帮助吗?

解决方案

The TW7ToolButton does not appear to have an event for clicking on the split button arrow so this may be the best you can do with the current component version:

procedure TForm1.W7ToolButton1Click(Sender: TObject);
var
  iPoint: TPoint;
begin
  iPoint := ClientToScreen(Point(W7ToolButton1.Left, W7ToolButton1.Top + W7ToolButton1.Height));
  PopupMenu1.Popup(iPoint.X, iPoint.Y);
end;

The menu will appear under the button just like a dropdown menu.

其他提示

I am not familiar with TMS, however, with regular button/speedbutton you could use something like:

PopupMenu1.Popup (Form1.Left + SpeedButton1.Left + SpeedButton1.Height, Form1.Top + SpeedButton1.Top + SpeedButton1.Width);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top