Jump to content
avon

Some TSpeedButton have black background after enabling Custom TitleBar

Recommended Posts

Posted (edited)

I recently startet to experiment with TTitleBar in Delphi 12. After enabling it I get a strange behaviour for some TSpeedButtons that are within a TCategoryPanelGroup. I am not sure if the TitleBar is the real reason or just surfaced another general problem. The problem is only existing for the buttons in the last TCategoryPanels, it seems like those are the ones that would be "outside of the window" when all panels are extended, of course this is avoided by a scrollbar. Attached is a screenshot of the last panel that is working and the first with the problem, both are 100% identical.

The general structure of the window is: Window -> TPanel -> TCategoryPanelGroup-> TCategoryPanel (-> TPanel) -> multiple TSpeedButtons. The TPanel in brackets was an attempt to workaround the issue, but has no effect.

The following steps fix the issue when the app is running: Resizing the window by a tiny bit and then collapsing and reopening the TCategoryPanel.

This following (ugly) workaround fixes the issue in code when added to the end of the FormActivate function. The black buttons are however still visible for a split second on loading.

  Width :=StandardWindowWidth-1;
  Height:=StandardWindowHeight-1;

  Width :=StandardWindowWidth+1;
  Height:=StandardWindowHeight+1;

 

Has anyone encountered a similar problems and recognizes the underlying issue here? It seems that the Speed Buttons are unable to get the same background color for some reason when being part of a TCategoryPanelGroup.

How does the Custom Title Bar "activate" this issue with the rest of the window unchanged?

 

- Thank you!

BlackSpeedButtons.JPG

Edited by avon

Share this post


Link to post
Posted (edited)

I was getting a similar issue so used the EMB example code components which were TToolbar and associated buttons.

That worked to a large extent until testing under Win Server 2022 which again was drawing the black areas unlike Win10 etc

So in the end to control any colors I had to remove any styles and use the default windows VCL style.

I then had to use the Form.Activate to set the background colors if they werent transparent.

Mine worked fine with the Form.Activate but from memory the EMB example used the WM_ACTIVATE message to set the colors.

Its probably a bug for when Styles are set but no way to report that last time I looked.

Edited by bdw_nz20

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

×