我需要一个ListBox组件,可以显示RTF数据,不知是否有可以下载?或者如何实现?谢谢。

解决方案 »

  1.   

    好象没有。实现起来麻烦,因为要解释RTF.
    如果只是需要不同颜色,字体,可以用自绘实现。
    Listbox1.lbOwnerDrawFixed;
    procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
      Rect: TRect; State: TOwnerDrawState);
    begin
      //在这里自己画
      s:=(Control as TListbox).Items[Index];  ListBox1.Canvas.Font.Color := clBlue;
      DrawText((Control as TListbox).Canvas.Handle,pchar(s),length(s),Rect,DT_LEFT);end;
      

  2.   

    用TRichText就可以啦!什么ListBox嘛!