dbgrid的最左边的标识记录的小箭头,是文字还是图片啊!
如果是文字ASCII是多少啊!

解决方案 »

  1.   

    是个图片
    在delphi安装目录下的lib目录中
    有个dbgrids.res
    用一些资源提取工具可以打开
    用ImageEditor好像打不开
    我用vc打开地
      

  2.   

    在dbgrids.pas中有const
      bmArrow = 'DBGARROW';
    然后在
    TCustomDBGrid.Create中
        Bmp.LoadFromResourceName(HInstance, bmArrow);  //从程序所链的DBGrids.res中装载图片
        FIndicators := TImageList.CreateSize(Bmp.Width, Bmp.Height);然后用
    FIndicators来画
      

  3.   

    //参考StringGrid绘制三角
    const
      MY_DRAWCELL = WM_USER + 10;type
      TForm1 = class(TForm)
        StringGrid1: TStringGrid;
        procedure FormCreate(Sender: TObject);
        procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
          Rect: TRect; State: TGridDrawState);
      private
        procedure MyDrawCell(var Msg: TMessage); message MY_DRAWCELL;
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    begin
      StringGrid1.DefaultRowHeight := 17;
      StringGrid1.ColWidths[0] := 11;
    end;procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
      if ARow = TStringGrid(Sender).Row then
        PostMessage(Handle, MY_DRAWCELL, Rect.Top, 0);
    end;procedure TForm1.MyDrawCell(var Msg: TMessage);
    const
      {$J+}vWParam: DWORD = 0;{$J-}
    begin
      with StringGrid1.Canvas, Msg do
      begin
        ///////Begin 清除上一次的三角
        Pen.Color := clBtnFace;
        Brush.Color := clBtnFace;
        Polygon([
          Point(3, vWParam + 3),
          Point(8, vWParam + 8),
          Point(3, vWParam + 13)
        ]);
        ///////End 清除上一次的三角    Pen.Color := clBlack;
        Brush.Color := clBlack;
        Polygon([
          Point(3, WParam + 3),
          Point(8, WParam + 8),
          Point(3, WParam + 13)
        ]);
        vWParam := WParam;
      end;
    end;