改listview1.canvas.font属性。
listview1.canvas.font:=listview1.font;

解决方案 »

  1.   

    如果方便的话,把onDrawItem里的内容帖出来,
    在你看看你的listview1.font.style是不是空的?
      

  2.   

    麻烦你看看了。
      if Item.SubItems[3]<>'' then    
        begin
          g := TBitmap.Create;
          //g.LoadFromFile(ExtractFilePath(ParamStr(0))+'\pics\tick.bmp');
          ImageList1.GetBitmap(0,g);
          //LV.Canvas.Brush.Color :=clWhite;
          //LV.Canvas.Font.Name   :='MS Sans Serif';
          //LV.Canvas.TextOut(item.Left,item.Top,item.Caption);
          LV.Canvas.Draw(333,item.Top,g);
        end;
    假如加上LVPostNetsList.Canvas.Font := LVPostNetsList.Font;就会有运行期错误。
      

  3.   

    以上是onCustemDrawSubItem里面的。onDrawItem里面没有东西。
      

  4.   


      if Item.SubItems[3]<>'' then    
        begin
          g := TBitmap.Create;
          //g.LoadFromFile(ExtractFilePath(ParamStr(0))+'\pics\tick.bmp');
          ImageList1.GetBitmap(0,g);
          LV.Canvas.Brush.Color :=clWhite;
          LV.Canvas.Font.Name   :='MS Sans Serif';
          LV.Canvas.TextOut(item.Left,item.Top,item.Caption);
          LV.canvas.font.style:=[];//加上这句试试
          LV.Canvas.Draw(333,item.Top,g);
        end;
      

  5.   

    果然有一点效用!画图片的那一行的问题已经解决,但是产生了新问题:画图片的下一行的字体变成了黑体!!看来把style变为原来的就可以了?怎么写语句呢?
      

  6.   


       LV.canvas.font.style:=[];//放在这儿试试
      if Item.SubItems[3]<>'' then    
        begin
          g := TBitmap.Create;
          //g.LoadFromFile(ExtractFilePath(ParamStr(0))+'\pics\tick.bmp');
          ImageList1.GetBitmap(0,g);
          LV.Canvas.Brush.Color :=clWhite;
          LV.Canvas.Font.Name   :='MS Sans Serif';
          LV.Canvas.TextOut(item.Left,item.Top,item.Caption);
          LV.Canvas.Draw(333,item.Top,g);
        end;
      

  7.   

    或  if Item.SubItems[3]<>'' then    
        begin
          g := TBitmap.Create;
          //g.LoadFromFile(ExtractFilePath(ParamStr(0))+'\pics\tick.bmp');
          ImageList1.GetBitmap(0,g);
          LV.Canvas.Brush.Color :=clWhite;
          LV.Canvas.Font.Name   :='MS Sans Serif';
          LV.canvas.font.style:=[];//放在这儿试试
          LV.Canvas.TextOut(item.Left,item.Top,item.Caption);
          LV.Canvas.Draw(333,item.Top,g);
        end else LV.canvas.font.style:=[];//放在这儿试试