Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8635689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:02:33+00:00 2026-06-12T10:02:33+00:00

I have noticed a rather annoying oddity with Delphi toolbars. I have a TToolbar

  • 0

I have noticed a rather annoying oddity with Delphi toolbars. I have a TToolbar that has logical groups of icons. To make the grouping stand out I would like to use separator buttons, with style tbsDivider.

When I do this, it looks like this:

enter image description here

Note the double vertical lines between each icon. The right hand one is in the middle of the separator tool button. The left hand one is on the left edge of the separator tool button.

So, I can switch to tbsSeparator which removes the middle line:

enter image description here

But I’m not keen on that since I’d like the divider to be in the middle.

I looked at an ancient version of my real app and found that it had centred separators. It seems that is possible when Windows themes are disabled. Here’s what it looks like with tbsDivider and the application manifest removed:

enter image description here

That’s the layout I am looking for. Is this attainable when themes are active?

I did find a discussion of the issue on the Embarcadero forums, but there was no useful insight: https://forums.embarcadero.com/message.jspa?messageID=467842

For sake of completeness, here’s the pertinent extract from the .dfm file

object ToolButton1: TToolButton
  Left = 0
  Top = 0
  ImageIndex = 0
end
object ToolButton2: TToolButton
  Left = 23
  Top = 0
  Width = 16
  ImageIndex = 1
  Style = tbsDivider
end
object ToolButton3: TToolButton
  Left = 39
  Top = 0
  ImageIndex = 1
end
object ToolButton4: TToolButton
  Left = 62
  Top = 0
  Width = 16
  ImageIndex = 2
  Style = tbsDivider
end
object ToolButton5: TToolButton
  Left = 78
  Top = 0
  ImageIndex = 2
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:02:34+00:00Added an answer on June 12, 2026 at 10:02 am

    The native control draws the vertical line for a separator button when the toolbar has the flat style. So if you remove the flat style, you’d be left alone with the VCL’s divider line. You can safely remove the style when the application is themed, themed toolbar buttons does not regard flat style (why toolbar separators does, I have no idea). However when themes are disabled there’ll again be two lines. In that case keeping separators instead of dividers seems like the better option.

    One would guess unsetting the Flat property would have any effect as the documentation states. However TToolBar.CreateParams unconditionally enables it when StyleServices is enabled. So an API call is necessary;

    procedure TForm1.FormCreate(Sender: TObject);
    var
      TbStyle: DWORD;
    begin
      if StyleServices.Enabled then begin
        TbStyle := SendMessage(ToolBar1.Handle, TB_GETSTYLE, 0, 0);
        SendMessage(Toolbar1.Handle, TB_SETSTYLE, 0, TbStyle and not TBSTYLE_FLAT);
      end;
    end;
    

    This eliminates part of the problem, the remaining part is the divider line is not exactly in the center between two buttons. VCL’s problem here is, it does not want to draw the line itself. So it calls the theme api which draws the separator line to the left of the separator. To circumvent, VCL passes about the right half of the separator rectangle to the api, and the line gets about in the middle. I don’t know if there’s any way to tell exactly where the theme api draws it and I doubt there is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have noticed that numerous Date methods in Java have been deprecated, but rather
We have noticed that component publishing takes a long time. The component we are
I have noticed that if you add a unobtrusive link in a refreshable partial
I have noticed FF, Chrome and Safari behaving such that if you intervene to
I have noticed a number of kernel sources that look like this (found randomly
I have noticed that deleted branches in svn is not preserved in git. I
I have noticed that ie tends to put the thread for a tab to
I have noticed that it is possible to define a custom class and then
I have noticed that most Objective-C coders never use the self->ivar syntax when accessing
I have noticed that in most google maps you can not drag the marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.