![]() |
Combobox eigenbau
Hallo DP gemeinde,
Ich hoffe ihr könnt mir bei folgendem Problem helfen: Ich bin gerade dabei eine Combobox-Komponente zu schreiben, bei der man schon im OI festlegen kann, welche Elemente aktiviert und welche deaktiviert(grau) sein sollen. Die Elemente habe ich als Objekte in der Combobox gespeichert(als property). Die Auswahl im OI funktioniert schon, aber die Elemente werden nicht angezeigt Hier der Code der DrawItem Methode
Delphi-Quellcode:
procedure TCustomSpzComboBox.DrawItem(Index: Integer; Rect: TRect;
State: TOwnerDrawState); begin TControlCanvas(Canvas).UpdateTextFlags; if Assigned(OnDrawItem) then OnDrawItem(Self, Index, Rect, State) else begin Canvas.FillRect(Rect); //FSpzItems ist eine TCollection if not TSpzItem(FSpzItems.Items[Index]).Enabled then Canvas.Font.Color:=clSilver; if Index >= 0 then Canvas.TextOut(Rect.Left + 2, Rect.Top, TSpzItem(SpzItems.items[Index]).name); end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:38 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz