Why is the TToolBar button automatically configured when ShowCaption is set to True?

I need to have two TToolBaron the right side of my main form, so I overlay three TPanelfor alignment and then put TToolBarinside them. I tried to say that it toolbuttonhas the same width for the last day, but to no avail. Here is a screenshot of what I have: enter image description here

I found out that if ShowCaptionset to True, toolbars automatically calculate the width of a button. My question is why, and how to disable it?

+5
source share
2 answers

Take a look at this approach:

  • Set all buttons to Auto Size for False.
  • Call the following inside the Forms OnCreate event: SendMessage(ToolBar3.Handle,TB_SETBUTTONWIDTH, 0, MAKELPARAM(0, <DEFAULT_WIDTH_THAT_YOU_WANT_TO_SET>));
  • , Visible - , , .
  • , , "CommCtrl" TB_SETBUTTONWIDTH.

: http://zarko-gajic.iz.hr/ttoolbars-ttoolbutton-autosize-width-issues-empty-caption/

+2

, , formcreate onpaint onresize .., ........

-2

All Articles