给自己一点时间接受自己,爱自己,趁着下午茶的时间来学习图老师推荐的怎么让TreeView前面显示CheckBox,过去的都会过去,迎接崭新的开始,释放更美好的自己。
【 tulaoshi.com - 编程语言 】
我的主页: http://www.tommstudio.com/
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)下面的代码可以让Treeview前面显示CheckBox.
  const
  TVS_CHECKBOXES = $00000100;
  
  procedure SetComCtrlStyle(WinCtrl: TWinControl; Value: Integer; UseStyle: Boolean);
  var
  Style: Integer;
  begin
    if WinCtrl.HandleAllocated then
    begin
      Style := GetWindowLong(WinCtrl.Handle, GWL_STYLE);
      if not UseStyle then
      Style := Style and not Value
      else Style := Style or Value;
      SetWindowLong(WinCtrl.Handle, GWL_STYLE, Style);
    end;
  end;
  
  SetComCtrlStyle(TreeView1, TVS_CHECKBOXES, True);
  SetWindowLong(TreeView1.Handle, GWL_STYLE, GetWindowLong(TreeView1.Handle, GWL_STYLE) or $00000100); 
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)来源:http://www.tulaoshi.com/n/20160219/1626365.html
看过《怎么让TreeView前面显示CheckBox》的人还看了以下文章 更多>>