Einzelnen Beitrag anzeigen

Natcree

Registriert seit: 5. Mär 2013
502 Beiträge
 
Delphi 7 Enterprise
 
#4

AW: Items in ComboBox rechtsbündig

  Alt 6. Mär 2013, 14:35
Oder Direkt für die Combobox...

Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
combobox1.style:=csownerdrawfixed;
end;

procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  with (Control as Tcombobox) do
  Canvas.TextRect(Rect, Rect.Right - Canvas.TextWidth(Items[Index]) - 2, Rect.Top, Items[Index]);
end;

Geändert von Natcree ( 6. Mär 2013 um 14:38 Uhr)
  Mit Zitat antworten Zitat