![]() |
Combobox - Items Centered
Weiss zufällig jemand wie ich bei einer TComboBox (genauergesagt geht es um die Unicode - TTNTComboBox) die Auswahl + Items zentriere?
Wie beim TEdit CreateParams zu überschreiben und ES_CENTER zu setzen funktioniert leider nicht. Bei ES_Center ist die Box nicht mehr beschreibbar und bei ES_Right entsprechen Darstellung und Verhalten ES_Left. Hat jemand eine Idee? [erledigt] Solve:
Code:
procedure TForm1.TntComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
var w, l : integer; text: widestring; begin text:= TntComboBox1.Items.Strings[Index]; w:= TntComboBox1.Canvas.TextWidth(text); l:= (Rect.Right - Rect.Left - w) div 2; TntComboBox1.Canvas.TextOut(Rect.Left + l, Rect.Top, text); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:01 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