Jump to content
Sign in to follow this  
Hugo Bendtner

TTitleBarPanel and System/Custom Buttons

Recommended Posts

I am exploring usage of the TTitleBarPanel in Delphi 10.4 and am struggling with the styling of the system buttons (which never take on the custom color of the TTitleBarPanel) and attempting to use Custom Buttons (TCaptionButtonItem) these never seem to display, although clicking in their location calls their attached events).

 

Have I got the basics wrong, or is the TTitleBarPanel lacking?

Share this post


Link to post

Did you set the required properties for CustomTitleBar? For example:

  CustomTitleBar.Control = TitleBarPanel1
  CustomTitleBar.Enabled = True
  CustomTitleBar.SystemColors = False
  CustomTitleBar.SystemButtons = False
  CustomTitleBar.BackgroundColor = clRed
  CustomTitleBar.ForegroundColor = 65793
  CustomTitleBar.InactiveBackgroundColor = clWhite
  CustomTitleBar.InactiveForegroundColor = 10066329
  CustomTitleBar.ButtonForegroundColor = 65793
  CustomTitleBar.ButtonBackgroundColor = clRed
  CustomTitleBar.ButtonHoverForegroundColor = 65793
  CustomTitleBar.ButtonHoverBackgroundColor = 16053492
  CustomTitleBar.ButtonPressedForegroundColor = 65793
  CustomTitleBar.ButtonPressedBackgroundColor = 15395562
  CustomTitleBar.ButtonInactiveForegroundColor = 10066329
  CustomTitleBar.ButtonInactiveBackgroundColor = clWhite
 

Share this post


Link to post

Yes, I believe so, see below (with System Buttons ON/True, which seem to always take Windows colors):

 

image.thumb.png.5fda5d33734489daa61d4d2423e9a075.png

 

When System Buttons is Off/False no buttons display, even though you can see 4 in Design Time.

 

I'm currently using these colors just to be obvious with what is going on (I wouldn't seriously be using them in my final application!).

Share this post


Link to post

Thanks very much, yes in my naivety setting everything to the same color caused the problem.

 

ButtonForegroundColor is what controls the color of the icon inside the button.

 

Again, thanks very much, common sense prevails!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×