Is programmatic toolbutton dropdown possible? lazarus / 31-LCL ---------------------------------------------------------------------- howardpc · 2015-07-21 22:06 You have a toolbar which has a toolbutton whose style is tbsDropDown with a non-nil popupmenu populated with items. Is there a way programmatically to show the dropdown items, or is it only possible by the user clicking on the down-arrow? ---------------------------------------------------------------------- taazz · 2015-07-21 22:09 Code: [Select]  PopupMenu1.PopUp(100,100); ---------------------------------------------------------------------- howardpc · 2015-07-22 07:29 I had already tried something similar. But it always gives me a runtime error 210, whether range-checking is enabled or not. Do you have a working compilable example? ---------------------------------------------------------------------- rvk · 2015-07-22 07:58 Quote from: howardpc on July 22, 2015, 09:29:05 amDo you have a working compilable example? Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var   pt: TPoint; begin   pt := ToolButton1.ClientToScreen(Point(0, ToolButton1.Height)); // correct position   Toolbutton1.DropdownMenu.PopUp(pt.X, pt.Y); end; You could try dabbling with some messaging (Perform WM_LEFTBUTTONDOWN/WM_LEFTBUTTONUP or something) so that the button seems to be pressed. I take it you did set the TPopupMenu to DropDownMenu (and not to PopupMenu). ---------------------------------------------------------------------- howardpc · 2015-07-22 11:06 Thank you both. I discovered I had inadvertently left a line of code in my trial project that set the dropdown menu to nil (after setting it to the correct value).