For me, the following worked in said button's OnClick
event:
ToolBar.Perform(TB_PRESSBUTTON, ToolButton.Index, 1);
TB_PRESSBUTTON
is defined in CommCtrl
as WM_USER + 3
, or 1027. Make sure to not set your tool button's Down
property to True. Setting Down
to False still works normally.