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/)
-   -   CheckListBoxDrawItem und TOwnerDrawState (https://www.delphipraxis.net/166797-checklistboxdrawitem-und-townerdrawstate.html)

Popov 29. Feb 2012 16:40

CheckListBoxDrawItem und TOwnerDrawState
 
Irgendwie sehe ich momentan das Problem nicht, allerdings habe ich noch nie in CheckListBox OnDrawItem genutzt

Delphi-Quellcode:
procedure TForm1.CheckListBoxDrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  with (Control as TCheckListBox) do
  begin
    if odSelected in State then
In der letzten Zeile kommt die Fehlermeldung

Code:
[Fehler] uMain.pas(115): '[' erwartet, aber 'THEN' gefunden

Bummi 29. Feb 2012 16:50

AW: CheckListBoxDrawItem und TOwnerDrawState
 
Liegt an Deinem With ... die Checklistbox hat auch State

property State[Index: Integer]: TCheckBoxState read GetState write SetState;

einfach den Parameter umbenennen

Delphi-Quellcode:
procedure TForm2.CheckListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; aState: TOwnerDrawState);
begin
  with (Control as TCheckListBox) do
  begin
    if odSelected in aState then
      begin

      end;
  end;
end;

p80286 29. Feb 2012 16:52

AW: CheckListBoxDrawItem und TOwnerDrawState
 
Könnte irgendjemand so freundlich sein und diesen Thread allen schicken die dieses "With" immer noch nutzen?

Bitte!

Gruß
K-H

Popov 29. Feb 2012 16:59

AW: CheckListBoxDrawItem und TOwnerDrawState
 
Danke, hab mir irgendwas in die Richtung gedacht, da sonst nichts verkehrt war.


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