如题,这样的控件好像现在很流行,但是我不知道怎么实现,谁能提供一下思路。

解决方案 »

  1.   

    //Treeview加Checkbox
    引用单元:uses Commctrl;
    procedure SetComCtlStyle(Ctl: TWinControl; Value: Integer; UseStyle: Boolean);
    var
      Style: Integer;
    begin
      if Ctl.HandleAllocated then
      begin
        Style := GetWindowLong(Ctl.Handle, GWL_STYLE);
        if not UseStyle then Style := Style and not Value
        else Style := Style or Value;
        SetWindowLong(Ctl.Handle, GWL_STYLE, Style);
      end;
    end;
    调用:SetComCtlStyle(Treeview1, TVS_CHECKBOXES, True);这样的问题已经很多次问了
      

  2.   

    要是不在这里问,打死我都不知道为什么这样写代码,看来好好学习win32是很必要的。谢谢 bee2518(迷茫ing) 。