Let TreeView on Checkbox

xiaoxiao2021-03-06  97

Detailed method: http://www.ccrun.com/doc/go.asp? Id = 562

1, let TreeView1 bring Checkbox: SetWindowlong (TreeView1-> Handle, GWL_Style, getWindowlong (TreeView1-> Handle, GWL_Style) | TVS_CHECKBOXES);

2, get the node node is selected: BOOL Checked = TreeView_GetCheckState (TreeView1-> Handle, Node-> ItemID);

3, set the selected status of node node: bool checked = true; treeview_setcheckstate (TreeView1-> Handle, Node-> ItemID, Checked); 4, set the selected state of Node Node and its subtocks (using recursive functions): void setchildchecked TTREEVIEW * TreeView, TTREENODE * NODE, BOOL Checked) {???? ??? TreeView_setCheckState (TreeView-> Handle, Node-> itemid, checked); ??? for (INT i = 0; i

Count; i )

??????? setchildchecked (TreeView, Node-> Item [i], checked);

}

转载请注明原文地址:https://www.9cbs.com/read-123460.html

New Post(0)