在OnDrawitem中自己画,这应该是唯一的处理方法。

解决方案 »

  1.   

    提供一个C++Builder的方法 void __fastcall TForm1::ListView1CustomDrawItem(TCustomListView *Sender,
          TListItem *Item, TCustomDrawState State, bool &DefaultDraw)
    {
      if ( Item->Index == 0 )
      {
        ListView1->Canvas->Font->Color = clRed;
        ListView1->Canvas->Font->Style = TFontStyles()<< fsBold;
        ListView1->Canvas->Font->Size  = 12;
        ListView1->Canvas->Font->Name  = "宋体";  }
      if ( Item->Index == 1 )
      {
        ListView1->Canvas->Font->Color = clGreen;
        ListView1->Canvas->Font->Style = TFontStyles() << fsUnderline;
        ListView1->Canvas->Font->Size  = 10;
        ListView1->Canvas->Font->Name  = "黑体";
      }
    }或者//-----------------------------------------------------
    void __fastcall TForm1::ListView1CustomDrawItem(TCustomListView *Sender,  TListItem *Item, TCustomDrawState State, bool &DefaultDraw)
    {
    if ( Item->Index == x )//x 为行数
      {
        Sender->Canvas->Font->Style=Sender->Canvas->Font->Style<<fsBold;
      }
    }