如上图,这个控件,我用SPY++看的类名是  SysListView32
百度了下,有人说是Delphi的ListVieW,于是我用了下但是还是不能弄成图片上那种效果,单击一行,CheckBox一样划上对勾...请教...如果实现图片中的效果及功能

解决方案 »

  1.   

    表格控件都能实现,比如StringGrid,ListView,DBGrid
    当然3方的更不用说了
      

  2.   

    ListView可行。。checkboxes属性即可。。
      

  3.   

    listview的自画功能,在ondrawitem事件里接管就可以了
      

  4.   

    ListVieW完全可以实现你现在说的这图的效果
      

  5.   


    implementation{$R *.dfm}const
      aCheck = '√';
      uCheck = '×';var
      EdtCol: Integer; // 记录EDIT1在Columns中的位置,1-  MaxColumns;
      EdtItem: Tlistitem;procedure TForm1.FormCreate(Sender: TObject);
    begin
      ListView1.ViewStyle := vsReport;
      ListView1.RowSelect := True;//必须
    end;procedure TForm1.ListView1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    var
      R: Trect;
      Pt: TPoint;
      wtmp, i: Integer;
    begin
      try
        EdtItem := ListView1.GetItemAt(X, Y); // 根据鼠标位置,得到所对应行的LISTITEM
        if EdtItem <> nil then
        begin
          // 根据鼠标位置,计算出是哪个 Columns.
          Pt := EdtItem.Position;
          wtmp := Pt.X;
          for i := 0 to ListView1.Columns.Count - 1 do
            if (X > wtmp) and (X < (wtmp + ListView1.Column[i].Width)) then
              Break // 找到对应的Columns.
            else
              inc(wtmp, ListView1.Column[i].Width);
          // 根据I的值,取得 Columns的对应位置。
          EdtCol := i;
          R := EdtItem.DisplayRect(drSelectBounds);      if (EdtCol > 0) and (i < 6) then
          begin
            if EdtItem.SubItems[i - 1] = aCheck then
              EdtItem.SubItems[i - 1] := uCheck
            else
              EdtItem.SubItems[i - 1] := aCheck;
          end
        end;
      except
        //
      end;
    end;