Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Combobox Selber zeichnen ? (https://www.delphipraxis.net/53362-combobox-selber-zeichnen.html)

Schucki 14. Sep 2005 21:55


Combobox Selber zeichnen ?
 
Hallo,

ich möchte gerne eine Combobox haben die sich von dem Design der Standardbox abhebt.
Ich veranlasse das neuzeichnen durch Messages die ich "überwache".

Delphi-Quellcode:
...
procedure WndProc(var Message: TMessage); override;
procedure CnCommand(var Message: TWMCommand); message CN_COMMAND;
...

procedure TMyComboBox.WndProc(var Message: TMessage);
begin
  case Message.Msg of
    WM_PAINT:begin
               inherited;
               PaintMyComboBox;
             end;
    else inherited;
  end;
end;

procedure TMyComboBox.CnCommand(var Message: TWMCommand);
begin
  case Message.NotifyCode of
    CBN_CLOSEUP:begin
      inherited;
      PaintMyComboBox;
    end;
    CBN_SELENDOK:begin
      inherited;
      PaintMyComboBox;
    end;
    else inherited;
  end;
end;
Soweit erstmal ganz gut.
Meine Combobox wird super gezeichnet und auch auf dem Schirm dargestellt nur wenn ich einen Eintrag auswähle dann wird "PaintMyCombobox" zwar einmal ausgefürt aber danach malt Windows einfach munter seinen Style drüber. :wall:

Warum ist das so, welche Message hab ich nicht berücksichtigt?

Gruß Schucki...


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:31 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