Einzelnen Beitrag anzeigen

Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#11

Re: Combobox: nicht editierbar

  Alt 23. Jul 2009, 09:57
Meinst du etwa so?

Delphi-Quellcode:
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  with Control as TComboBox do
  begin
    if DroppedDown and (odSelected in State) then
      Canvas.Brush.Color := clHighlight
    else
      Canvas.Brush.Color := clWindow;

    Canvas.Font.Color := clWindowText;
    Canvas.FillRect(Rect);
    Canvas.TextOut(Rect.Left + 2, Rect.Top + 2, Items[Index]);
  end;
end;
Thomas
  Mit Zitat antworten Zitat