Einzelnen Beitrag anzeigen

T-Olli

Registriert seit: 24. Sep 2003
4 Beiträge
 
#3

Re: Wort in Listbox mit Fett anzeigen?

  Alt 26. Sep 2003, 12:51
Um das in einer ListBox hinzubekommen wirst du die Ausgabe selber übernehmen müssen (style=lbOwnerDrawFixed). Die entsprechend OnDrawItem Routine könnte z.B. so aussehen:
Code:
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
begin
  Rect: TRect; State: TOwnerDrawState);
  with (Control as TListBox).Canvas do
  begin
    FillRect(Rect);
    PenPos := Rect.TopLeft;
    TextOut(PenPos.x, PenPos.y, 'Normale Schrift ');
    Font.Style := Font.Style + [fsBold];
    TextOut(PenPos.x, PenPos.y, 'Fette Schrift');
    Font.Style := Font.Style - [fsBold];
    TextOut(PenPos.x, PenPos.y, ' und weiter mit normaler Schrift');
  end;
end;
  Mit Zitat antworten Zitat