Как выровнять по правому краю пункты в ComboBox

Первым делом поместите на форму ComboBox, затем напишите следующий код:
procedure TForm1.FormCreate(Sender: TObject) ;
begin
ComboBox1.Style := csOwnerDrawFixed;
//для ListBox используйте "lbOwnerDrawFixed"
end;
//Обработчик события OnDrawItem
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState) ;
var
x: Integer;
txt: String;
begin
with ComboBox1 do
begin
Canvas.FillRect(Rect) ;
txt := Items[Index];
x := Rect.Right - Canvas.TextWidth(txt) - 4;
Canvas.TextOut(x, Rect.Top, txt) ;
end;
end;
Комментарии