Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   TPanel auf TStatusBar funktioniert nicht mehr (https://www.delphipraxis.net/203719-tpanel-auf-tstatusbar-funktioniert-nicht-mehr.html)

DieDolly 16. Mär 2020 19:09

TPanel auf TStatusBar funktioniert nicht mehr
 
Ein paar Jahre lang hatte ich immer ein Panel auf einer StatusBar. Auf dem Panel ein Label und ein Image.
Seit einiger Zeit, wann weiß ich nicht (ich schätze seit dem 10.3.3 Update) ist die StatusBar immer über dem Panel. Egal was ich mache, das Panel wird verdeckt.

Gibt es einen Trick den ich nicht kenne? Das Panel ist rechts unten auf dem Formular.

TiGü 17. Mär 2020 08:23

AW: TPanel auf TStatusBar funktioniert nicht mehr
 
Problem tritt auch bei einen neuen Beispielprojekt auf?

Rolf Frei 17. Mär 2020 13:20

AW: TPanel auf TStatusBar funktioniert nicht mehr
 
Bist du dir sicher, dass das Panel dahinter ist? Das normale TStatusbar akzeptiert keine Child-Controls und sollte so eigentlich nie funktioniert haben. Habe mir vor Jahren genau deswegen eine eigene abgeleitete TSatausBar gemacht, die Controls akzeptiert und damit habe ich keine Probleme in Rio. Die folgende Komponente könntest du dir dann mit einem Package installieren und deine TStatusbar mit TrfStatusbar ersetzen.

Delphi-Quellcode:
unit RFComCtrls;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  CommCtrl, ComCtrls;

type
  { TrfStatusBar }
  TrfStatusBar = class(TStatusBar)
  private
  published
    constructor Create(AOwner: TComponent); override;
  end;

implementation

uses
  Themes;

{ TrfStatusBar }

constructor TrfStatusBar.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  ControlStyle := ControlStyle + [csAcceptsControls]; // Dadurch lassen sich andere Controls auf der Statusbar platzieren
  DoubleBuffered := ThemeServices.ThemesEnabled;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz