{"id":51110,"date":"2025-08-10T17:44:37","date_gmt":"2025-08-10T09:44:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/51110.html"},"modified":"2025-08-10T17:44:37","modified_gmt":"2025-08-10T09:44:37","slug":"winform%e4%b9%8btreeview%e6%8e%a7%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/51110.html","title":{"rendered":"WinForm\u4e4bTreeView\u63a7\u4ef6"},"content":{"rendered":"<p>\u5728 WinForm \u4e2d&#xff0c;TreeView\u63a7\u4ef6\u7528\u4e8e\u5c55\u793a\u5c42\u7ea7\u7ed3\u6784\u6570\u636e&#xff08;\u5982\u6587\u4ef6\u76ee\u5f55\u3001\u7ec4\u7ec7\u67b6\u6784\u3001\u5206\u7c7b\u83dc\u5355\u7b49&#xff09;&#xff0c;\u901a\u8fc7 \u201c\u8282\u70b9&#xff08;TreeNode&#xff09;\u201d \u7684\u7236\u5b50\u5173\u7cfb\u5448\u73b0\u5c42\u7ea7&#xff0c;\u652f\u6301\u5c55\u5f00 \/ \u6298\u53e0\u3001\u9009\u62e9\u3001\u7f16\u8f91\u7b49\u4ea4\u4e92&#xff0c;\u662f\u5904\u7406\u6811\u5f62\u6570\u636e\u7684\u6838\u5fc3\u63a7\u4ef6\u3002<\/p>\n<h4>\u4e00\u3001\u63a7\u4ef6\u6838\u5fc3\u7279\u70b9\u4e0e\u7ed3\u6784<\/h4>\n<ul>\n<li>\n<p>\u6838\u5fc3\u5143\u7d20&#xff1a;\u7531TreeNode&#xff08;\u8282\u70b9&#xff09;\u7ec4\u6210&#xff0c;\u6bcf\u4e2a\u8282\u70b9\u53ef\u5305\u542b\u5b50\u8282\u70b9&#xff08;Nodes\u5c5e\u6027&#xff09;&#xff0c;\u5f62\u6210 \u201c\u6839\u8282\u70b9\u2192\u5b50\u8282\u70b9\u2192\u5b59\u8282\u70b9\u201d \u7684\u5c42\u7ea7\u5173\u7cfb\u3002<\/p>\n<\/li>\n<li>\n<p>\u4ea4\u4e92\u80fd\u529b&#xff1a;\u652f\u6301\u70b9\u51fb\u5c55\u5f00 \/ \u6298\u53e0&#xff08;\u53cc\u51fb\u6216\u70b9\u51fb \u201c&#043;\/-\u201d \u56fe\u6807&#xff09;\u3001\u8282\u70b9\u9009\u62e9\u3001\u6587\u672c\u7f16\u8f91\u3001\u62d6\u62fd\u8282\u70b9\u7b49\u3002<\/p>\n<\/li>\n<li>\n<p>\u89c6\u89c9\u5b9a\u5236&#xff1a;\u53ef\u8bbe\u7f6e\u8282\u70b9\u56fe\u6807\u3001\u8fde\u7ebf\u6837\u5f0f\u3001\u9009\u4e2d\u72b6\u6001\u6837\u5f0f\u7b49&#xff0c;\u63d0\u5347\u5c42\u7ea7\u8fa8\u8bc6\u5ea6\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>\u4e8c\u3001\u6838\u5fc3\u5c5e\u6027\u4e0e\u4e8b\u4ef6&#xff08;\u8868\u683c\u6574\u7406&#xff09;<\/h4>\n<table>\n<tr>\u7c7b\u522b\u540d\u79f0\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u8282\u70b9\u7ba1\u7406<\/td>\n<td>Nodes<\/td>\n<td>\u63a7\u4ef6\u7684\u6839\u8282\u70b9\u96c6\u5408&#xff08;TreeNodeCollection&#xff09;&#xff0c;\u901a\u8fc7Add()\u6dfb\u52a0\u6839\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>SelectedNode<\/td>\n<td>\u83b7\u53d6\u6216\u8bbe\u7f6e\u5f53\u524d\u9009\u4e2d\u7684\u8282\u70b9&#xff08;TreeNode&#xff09;&#xff0c;null\u8868\u793a\u65e0\u9009\u4e2d\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>TopNode<\/td>\n<td>\u83b7\u53d6\u6216\u8bbe\u7f6e\u53ef\u89c1\u533a\u57df\u7684\u9876\u90e8\u8282\u70b9&#xff08;\u7528\u4e8e\u6eda\u52a8\u5b9a\u4f4d&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5916\u89c2\u6837\u5f0f<\/td>\n<td>ShowPlusMinus<\/td>\n<td>\u662f\u5426\u5728\u53ef\u5c55\u5f00 \/ \u6298\u53e0\u8282\u70b9\u524d\u663e\u793a \u201c&#043;\u201d\u201c-\u201d \u56fe\u6807&#xff08;\u9ed8\u8ba4true&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>ShowRootLines<\/td>\n<td>\u662f\u5426\u663e\u793a\u6839\u8282\u70b9\u4e4b\u95f4\u7684\u8fde\u7ebf&#xff08;\u9ed8\u8ba4true&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>ShowLines<\/td>\n<td>\u662f\u5426\u663e\u793a\u6240\u6709\u8282\u70b9\u4e4b\u95f4\u7684\u8fde\u7ebf&#xff08;\u9ed8\u8ba4true&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>ImageList<\/td>\n<td>\u5173\u8054\u7684ImageList\u63a7\u4ef6&#xff08;\u7528\u4e8e\u8bbe\u7f6e\u8282\u70b9\u7684\u56fe\u6807&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>CheckBoxes<\/td>\n<td>\u662f\u5426\u5728\u8282\u70b9\u524d\u663e\u793a\u590d\u9009\u6846&#xff08;\u9ed8\u8ba4false&#xff0c;\u7528\u4e8e\u591a\u9009\u573a\u666f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u4ea4\u4e92\u63a7\u5236<\/td>\n<td>AllowEdit<\/td>\n<td>\u662f\u5426\u5141\u8bb8\u7528\u6237\u7f16\u8f91\u8282\u70b9\u6587\u672c&#xff08;\u9ed8\u8ba4false&#xff0c;\u53cc\u51fb\u8282\u70b9\u6587\u672c\u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>AllowDragDrop<\/td>\n<td>\u662f\u5426\u5141\u8bb8\u62d6\u62fd\u8282\u70b9&#xff08;\u9ed8\u8ba4false&#xff0c;\u9700\u914d\u5408\u62d6\u62fd\u4e8b\u4ef6\u5b9e\u73b0\u529f\u80fd&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>Sorted<\/td>\n<td>\u8282\u70b9\u662f\u5426\u81ea\u52a8\u6392\u5e8f&#xff08;\u9ed8\u8ba4false&#xff0c;true\u65f6\u6309\u6587\u672c\u5347\u5e8f\u6392\u5217\u540c\u7ea7\u8282\u70b9&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u6838\u5fc3\u4e8b\u4ef6<\/td>\n<td>AfterSelect<\/td>\n<td>\u8282\u70b9\u9009\u4e2d\u72b6\u6001\u53d8\u5316\u540e\u89e6\u53d1&#xff08;\u83b7\u53d6\u65b0\u9009\u4e2d\u7684\u8282\u70b9&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>NodeMouseClick<\/td>\n<td>\u9f20\u6807\u70b9\u51fb\u8282\u70b9\u65f6\u89e6\u53d1&#xff08;\u53ef\u533a\u5206\u5de6\u952e \/ \u53f3\u952e\u70b9\u51fb&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>BeforeExpand<\/td>\n<td>\u8282\u70b9\u5c55\u5f00\u524d\u89e6\u53d1&#xff08;\u53ef\u53d6\u6d88\u5c55\u5f00&#xff0c;\u5982\u6743\u9650\u6821\u9a8c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>AfterCollapse<\/td>\n<td>\u8282\u70b9\u6298\u53e0\u540e\u89e6\u53d1&#xff08;\u7528\u4e8e\u66f4\u65b0\u754c\u9762\u72b6\u6001&#xff09;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>NodeMouseDoubleClick<\/td>\n<td>\u53cc\u51fb\u8282\u70b9\u65f6\u89e6\u53d1&#xff08;\u5982\u7528\u4e8e\u7f16\u8f91\u8282\u70b9\u6216\u6253\u5f00\u8be6\u60c5&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u4e09\u3001\u57fa\u7840\u7528\u6cd5&#xff1a;\u521b\u5efa\u5c42\u7ea7\u8282\u70b9\u5e76\u4ea4\u4e92<\/h4>\n<h5>\u573a\u666f&#xff1a;\u5c55\u793a\u516c\u53f8\u90e8\u95e8\u4e0e\u5458\u5de5\u7684\u5c42\u7ea7\u7ed3\u6784&#xff08;\u6839\u8282\u70b9\u4e3a\u516c\u53f8&#xff0c;\u5b50\u8282\u70b9\u4e3a\u90e8\u95e8&#xff0c;\u5b59\u8282\u70b9\u4e3a\u5458\u5de5&#xff09;<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1175\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810094432-68986a00d81fa.png\" width=\"1575\" \/><\/p>\n<p>\u70b9\u51fb\u5bf9\u5e94\u4f4d\u7f6e\u7f16\u8f91\u8282\u70b9<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"252\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810094435-68986a0341db7.png\" width=\"481\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"736\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810094435-68986a035bf55.png\" width=\"1198\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"212\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810094436-68986a0423804.png\" width=\"288\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"175\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810094436-68986a045959d.png\" width=\"251\" \/><\/p>\n<p>\u6dfb\u52a0\u5bf9\u5e94\u6839\u8282\u70b9\u548c\u5b57\u8282\u70b9&#xff0c;\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u56fe\u7247<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"336\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810094436-68986a0481626.png\" width=\"449\" \/><\/p>\n<\/p>\n<h5>1. \u754c\u9762\u8bbe\u8ba1<\/h5>\n<p>\u5728\u7a97\u4f53\u4e2d\u6dfb\u52a0&#xff1a;<\/p>\n<ul>\n<li>\n<p>TreeView\u63a7\u4ef6&#xff08;\u547d\u540d\u4e3atreeView1&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>Button\u63a7\u4ef6&#xff08;\u547d\u540d\u4e3abtnAdd&#xff0c;\u6587\u672c \u201c\u6dfb\u52a0\u8282\u70b9\u201d&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>Label\u63a7\u4ef6&#xff08;\u547d\u540d\u4e3alblInfo&#xff0c;\u7528\u4e8e\u663e\u793a\u9009\u4e2d\u8282\u70b9\u4fe1\u606f&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>2. \u4ee3\u7801\u5b9e\u73b0&#xff08;\u52a8\u6001\u6dfb\u52a0\u8282\u70b9\u4e0e\u4e8b\u4ef6\u5904\u7406&#xff09;<\/h5>\n<p>using System;<br \/>\nusing System.Windows.Forms;<br \/>\n\u200b<br \/>\nnamespace TreeViewDemo<br \/>\n{<br \/>\n \u00a0 \u00a0public partial class Form1 : Form<br \/>\n \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0public Form1()<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0InitializeComponent();<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u521d\u59cb\u5316TreeView<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0InitTreeView();<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0private void InitTreeView()<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 1. \u6dfb\u52a0\u6839\u8282\u70b9&#xff08;\u516c\u53f8&#xff09;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TreeNode rootNode &#061; new TreeNode(&#034;\u79d1\u6280\u6709\u9650\u516c\u53f8&#034;);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0treeView1.Nodes.Add(rootNode);<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 2. \u4e3a\u6839\u8282\u70b9\u6dfb\u52a0\u5b50\u8282\u70b9&#xff08;\u90e8\u95e8&#xff09;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TreeNode dept1 &#061; new TreeNode(&#034;\u7814\u53d1\u90e8&#034;);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TreeNode dept2 &#061; new TreeNode(&#034;\u5e02\u573a\u90e8&#034;);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0rootNode.Nodes.Add(dept1);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0rootNode.Nodes.Add(dept2);<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 3. \u4e3a\u90e8\u95e8\u8282\u70b9\u6dfb\u52a0\u5b59\u8282\u70b9&#xff08;\u5458\u5de5&#xff09;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0dept1.Nodes.Add(new TreeNode(&#034;\u5f20\u4e09&#xff08;\u7ecf\u7406&#xff09;&#034;));<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0dept1.Nodes.Add(new TreeNode(&#034;\u674e\u56db&#xff08;\u5f00\u53d1&#xff09;&#034;));<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0dept2.Nodes.Add(new TreeNode(&#034;\u738b\u4e94&#xff08;\u4e13\u5458&#xff09;&#034;));<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 4. \u521d\u59cb\u5c55\u5f00\u6240\u6709\u8282\u70b9<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0treeView1.ExpandAll();<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ 5. \u5141\u8bb8\u7f16\u8f91\u8282\u70b9\u6587\u672c<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0treeView1.AllowEdit &#061; true;<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u8282\u70b9\u9009\u4e2d\u540e\u89e6\u53d1&#xff1a;\u663e\u793a\u8282\u70b9\u4fe1\u606f<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0if (e.Node !&#061; null)<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u83b7\u53d6\u8282\u70b9\u5c42\u7ea7&#xff08;\u6839\u8282\u70b9Level&#061;0&#xff0c;\u5b50\u8282\u70b9Level&#061;1&#xff0c;\u4ee5\u6b64\u7c7b\u63a8&#xff09;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0int level &#061; e.Node.Level;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0string levelDesc &#061; level &#061;&#061; 0 ? &#034;&#xff08;\u516c\u53f8&#xff09;&#034; : (level &#061;&#061; 1 ? &#034;&#xff08;\u90e8\u95e8&#xff09;&#034; : &#034;&#xff08;\u5458\u5de5&#xff09;&#034;);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0lblInfo.Text &#061; $&#034;\u9009\u4e2d&#xff1a;{e.Node.Text} {levelDesc}\\\\n\u8def\u5f84&#xff1a;{GetNodePath(e.Node)}&#034;;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u8f85\u52a9\u65b9\u6cd5&#xff1a;\u83b7\u53d6\u8282\u70b9\u7684\u5b8c\u6574\u8def\u5f84&#xff08;\u5982\u201c\u79d1\u6280\u6709\u9650\u516c\u53f8\u2192\u7814\u53d1\u90e8\u2192\u5f20\u4e09\u201d&#xff09;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0private string GetNodePath(TreeNode node)<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0string path &#061; node.Text;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TreeNode parent &#061; node.Parent;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0while (parent !&#061; null)<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0path &#061; parent.Text &#043; &#034;\u2192&#034; &#043; path;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0parent &#061; parent.Parent;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0return path;<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u6dfb\u52a0\u8282\u70b9\u6309\u94ae&#xff1a;\u5728\u9009\u4e2d\u8282\u70b9\u4e0b\u6dfb\u52a0\u5b50\u8282\u70b9<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0private void btnAdd_Click(object sender, EventArgs e)<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0if (treeView1.SelectedNode &#061;&#061; null)<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0MessageBox.Show(&#034;\u8bf7\u5148\u9009\u62e9\u4e00\u4e2a\u8282\u70b9&#034;);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0return;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  }<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u6dfb\u52a0\u65b0\u5b50\u8282\u70b9<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0string newNodeText &#061; &#034;\u65b0\u8282\u70b9&#034;;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u82e5\u9009\u4e2d\u7684\u662f\u5458\u5de5\u8282\u70b9&#xff08;Level&#061;2&#xff09;&#xff0c;\u65b0\u8282\u70b9\u9ed8\u8ba4\u540d\u4e3a\u201c\u65b0\u5458\u5de5\u201d<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0if (treeView1.SelectedNode.Level &#061;&#061; 2)<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0newNodeText &#061; &#034;\u65b0\u5458\u5de5&#034;;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u82e5\u9009\u4e2d\u7684\u662f\u90e8\u95e8\u8282\u70b9&#xff08;Level&#061;1&#xff09;&#xff0c;\u65b0\u8282\u70b9\u9ed8\u8ba4\u540d\u4e3a\u201c\u65b0\u5458\u5de5\u201d<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0else if (treeView1.SelectedNode.Level &#061;&#061; 1)<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0newNodeText &#061; &#034;\u65b0\u5458\u5de5&#034;;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u82e5\u9009\u4e2d\u7684\u662f\u6839\u8282\u70b9&#xff08;Level&#061;0&#xff09;&#xff0c;\u65b0\u8282\u70b9\u9ed8\u8ba4\u540d\u4e3a\u201c\u65b0\u90e8\u95e8\u201d<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0else if (treeView1.SelectedNode.Level &#061;&#061; 0)<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0newNodeText &#061; &#034;\u65b0\u90e8\u95e8&#034;;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  }<br \/>\n\u200b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TreeNode newNode &#061; new TreeNode(newNodeText);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0treeView1.SelectedNode.Nodes.Add(newNode);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u5c55\u5f00\u7236\u8282\u70b9&#xff0c;\u663e\u793a\u65b0\u8282\u70b9<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0treeView1.SelectedNode.Expand();<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u9009\u4e2d\u65b0\u8282\u70b9<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0treeView1.SelectedNode &#061; newNode;<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0  }<br \/>\n}<\/p>\n<h4>\u56db\u3001\u8fdb\u9636\u7528\u6cd5\u4e0e\u573a\u666f<\/h4>\n<h5>1. \u4e3a\u8282\u70b9\u8bbe\u7f6e\u56fe\u6807&#xff08;\u7ed3\u5408 ImageList&#xff09;<\/h5>\n<p>\u901a\u8fc7ImageList\u4e3a\u4e0d\u540c\u7c7b\u578b\u7684\u8282\u70b9\u8bbe\u7f6e\u56fe\u6807&#xff08;\u5982\u6839\u8282\u70b9\u7528\u516c\u53f8\u56fe\u6807&#xff0c;\u90e8\u95e8\u7528\u6587\u4ef6\u5939\u56fe\u6807&#xff09;&#xff1a;<\/p>\n<p>\/\/ 1. \u5148\u5728\u7a97\u4f53\u6dfb\u52a0ImageList\u63a7\u4ef6&#xff08;\u547d\u540d\u4e3aimageList1&#xff09;&#xff0c;\u5e76\u6dfb\u52a0\u56fe\u6807&#xff08;\u5982\u7d22\u5f150&#xff1a;\u516c\u53f8\u56fe\u6807&#xff0c;1&#xff1a;\u90e8\u95e8\u56fe\u6807&#xff0c;2&#xff1a;\u5458\u5de5\u56fe\u6807&#xff09;<br \/>\n\/\/ 2. \u5173\u8054TreeView\u4e0eImageList<br \/>\ntreeView1.ImageList &#061; imageList1;<br \/>\n\u200b<br \/>\n\/\/ 3. \u4e3a\u8282\u70b9\u8bbe\u7f6e\u56fe\u6807&#xff08;ImageIndex&#xff1a;\u9ed8\u8ba4\u56fe\u6807&#xff0c;SelectedImageIndex&#xff1a;\u9009\u4e2d\u65f6\u7684\u56fe\u6807&#xff09;<br \/>\nTreeNode rootNode &#061; new TreeNode(&#034;\u79d1\u6280\u6709\u9650\u516c\u53f8&#034;);<br \/>\nrootNode.ImageIndex &#061; 0; \u00a0 \u00a0 \u00a0 \/\/ \u9ed8\u8ba4\u663e\u793a\u516c\u53f8\u56fe\u6807<br \/>\nrootNode.SelectedImageIndex &#061; 0; \/\/ \u9009\u4e2d\u65f6\u4ecd\u663e\u793a\u516c\u53f8\u56fe\u6807<br \/>\n\u200b<br \/>\nTreeNode deptNode &#061; new TreeNode(&#034;\u7814\u53d1\u90e8&#034;);<br \/>\ndeptNode.ImageIndex &#061; 1; \u00a0 \u00a0 \u00a0 \/\/ \u90e8\u95e8\u56fe\u6807<br \/>\ndeptNode.SelectedImageIndex &#061; 1;<br \/>\n\u200b<br \/>\nTreeNode empNode &#061; new TreeNode(&#034;\u5f20\u4e09&#034;);<br \/>\nempNode.ImageIndex &#061; 2; \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u5458\u5de5\u56fe\u6807<br \/>\nempNode.SelectedImageIndex &#061; 2;<\/p>\n<h5>2. \u8282\u70b9\u590d\u9009\u6846&#xff08;\u591a\u9009\u573a\u666f&#xff09;<\/h5>\n<p>\u8bbe\u7f6eCheckBoxes &#061; true\u663e\u793a\u590d\u9009\u6846&#xff0c;\u7528\u4e8e\u6279\u91cf\u9009\u62e9\u8282\u70b9&#xff08;\u5982\u6279\u91cf\u5220\u9664\u3001\u6743\u9650\u5206\u914d&#xff09;&#xff1a;<\/p>\n<p>\/\/ \u542f\u7528\u590d\u9009\u6846<br \/>\ntreeView1.CheckBoxes &#061; true;<br \/>\n\u200b<br \/>\n\/\/ \u6309\u94ae&#xff1a;\u83b7\u53d6\u6240\u6709\u52fe\u9009\u7684\u8282\u70b9<br \/>\nprivate void btnGetCheckedNodes_Click(object sender, EventArgs e)<br \/>\n{<br \/>\n \u00a0 \u00a0string checkedNodes &#061; &#034;&#034;;<br \/>\n \u00a0 \u00a0\/\/ \u9012\u5f52\u904d\u5386\u6240\u6709\u8282\u70b9&#xff0c;\u6536\u96c6\u52fe\u9009\u7684\u8282\u70b9<br \/>\n \u00a0 \u00a0CollectCheckedNodes(treeView1.Nodes, ref checkedNodes);<br \/>\n \u00a0 \u00a0MessageBox.Show($&#034;\u52fe\u9009\u7684\u8282\u70b9&#xff1a;\\\\n{checkedNodes}&#034;);<br \/>\n}<br \/>\n\u200b<br \/>\n\/\/ \u9012\u5f52\u6536\u96c6\u52fe\u9009\u7684\u8282\u70b9<br \/>\nprivate void CollectCheckedNodes(TreeNodeCollection nodes, ref string result)<br \/>\n{<br \/>\n \u00a0 \u00a0foreach (TreeNode node in nodes)<br \/>\n \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0if (node.Checked)<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0result &#043;&#061; node.Text &#043; &#034;\\\\n&#034;;<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u9012\u5f52\u5904\u7406\u5b50\u8282\u70b9<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0if (node.Nodes.Count &gt; 0)<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0CollectCheckedNodes(node.Nodes, ref result);<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0  }<br \/>\n}<\/p>\n<h5>3. \u8282\u70b9\u53f3\u952e\u83dc\u5355&#xff08;\u53f3\u952e\u64cd\u4f5c\u8282\u70b9&#xff09;<\/h5>\n<p>\u4e3a\u8282\u70b9\u6dfb\u52a0\u53f3\u952e\u83dc\u5355&#xff08;\u5982 \u201c\u91cd\u547d\u540d\u201d\u201c\u5220\u9664\u201d\u201c\u6dfb\u52a0\u5b50\u8282\u70b9\u201d&#xff09;&#xff1a;<\/p>\n<p>\/\/ 1. \u6dfb\u52a0ContextMenuStrip\u63a7\u4ef6&#xff08;\u547d\u540d\u4e3acontextMenuStrip1&#xff09;&#xff0c;\u5e76\u6dfb\u52a0\u83dc\u5355\u9879&#xff08;\u91cd\u547d\u540d\u3001\u5220\u9664&#xff09;<br \/>\n\/\/ 2. \u7ed1\u5b9aTreeView\u7684\u53f3\u952e\u83dc\u5355<br \/>\ntreeView1.ContextMenuStrip &#061; contextMenuStrip1;<br \/>\n\u200b<br \/>\n\/\/ 3. \u53f3\u952e\u83dc\u5355\u9879\u70b9\u51fb\u4e8b\u4ef6&#xff1a;\u91cd\u547d\u540d\u8282\u70b9<br \/>\nprivate void renameToolStripMenuItem_Click(object sender, EventArgs e)<br \/>\n{<br \/>\n \u00a0 \u00a0if (treeView1.SelectedNode !&#061; null)<br \/>\n \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0treeView1.LabelEdit &#061; true; \/\/ \u5141\u8bb8\u7f16\u8f91<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0treeView1.SelectedNode.BeginEdit(); \/\/ \u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f<br \/>\n \u00a0  }<br \/>\n}<br \/>\n\u200b<br \/>\n\/\/ 4. \u53f3\u952e\u83dc\u5355\u9879\u70b9\u51fb\u4e8b\u4ef6&#xff1a;\u5220\u9664\u8282\u70b9<br \/>\nprivate void deleteToolStripMenuItem_Click(object sender, EventArgs e)<br \/>\n{<br \/>\n \u00a0 \u00a0if (treeView1.SelectedNode !&#061; null)<br \/>\n \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0if (MessageBox.Show($&#034;\u786e\u5b9a\u5220\u9664\u201c{treeView1.SelectedNode.Text}\u201d\u5417&#xff1f;&#034;, &#034;\u63d0\u793a&#034;, MessageBoxButtons.YesNo) &#061;&#061; DialogResult.Yes)<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0treeView1.SelectedNode.Remove(); \/\/ \u5220\u9664\u8282\u70b9<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0  }<br \/>\n}<\/p>\n<h5>4. \u5ef6\u8fdf\u52a0\u8f7d\u5b50\u8282\u70b9&#xff08;\u4f18\u5316\u5927\u6570\u636e\u91cf\u6027\u80fd&#xff09;<\/h5>\n<p>\u5f53\u8282\u70b9\u5c42\u7ea7\u6df1\u3001\u6570\u91cf\u591a\u65f6&#xff0c;\u4e00\u6b21\u6027\u52a0\u8f7d\u6240\u6709\u8282\u70b9\u4f1a\u5bfc\u81f4\u5361\u987f\u3002\u53ef\u91c7\u7528 \u201c\u5ef6\u8fdf\u52a0\u8f7d\u201d&#xff1a;\u521d\u59cb\u53ea\u52a0\u8f7d\u6839\u8282\u70b9\u548c\u4e00\u7ea7\u8282\u70b9&#xff0c;\u5c55\u5f00\u8282\u70b9\u65f6\u518d\u52a0\u8f7d\u5176\u5b50\u8282\u70b9\u3002<\/p>\n<p>\/\/ \u521d\u59cb\u5316&#xff1a;\u53ea\u52a0\u8f7d\u6839\u8282\u70b9\u548c\u4e00\u7ea7\u8282\u70b9&#xff08;\u6807\u8bb0\u4e3a\u201c\u5f85\u52a0\u8f7d\u201d&#xff09;<br \/>\nprivate void InitLazyLoad()<br \/>\n{<br \/>\n \u00a0 \u00a0TreeNode root &#061; new TreeNode(&#034;\u6587\u4ef6\u7cfb\u7edf&#034;);<br \/>\n \u00a0 \u00a0treeView1.Nodes.Add(root);<br \/>\n\u200b<br \/>\n \u00a0 \u00a0\/\/ \u6dfb\u52a0\u4e00\u7ea7\u8282\u70b9&#xff08;\u6587\u4ef6\u5939&#xff09;&#xff0c;\u5e76\u6807\u8bb0Tag\u4e3a&#034;unloaded&#034;\u8868\u793a\u672a\u52a0\u8f7d\u5b50\u8282\u70b9<br \/>\n \u00a0 \u00a0TreeNode folder1 &#061; new TreeNode(&#034;\u6587\u6863&#034;);<br \/>\n \u00a0 \u00a0folder1.Tag &#061; &#034;unloaded&#034;; \/\/ \u81ea\u5b9a\u4e49\u6807\u8bb0<br \/>\n \u00a0 \u00a0root.Nodes.Add(folder1);<br \/>\n}<br \/>\n\u200b<br \/>\n\/\/ \u8282\u70b9\u5c55\u5f00\u524d\u89e6\u53d1&#xff1a;\u52a0\u8f7d\u5b50\u8282\u70b9<br \/>\nprivate void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)<br \/>\n{<br \/>\n \u00a0 \u00a0\/\/ \u82e5\u8282\u70b9\u6807\u8bb0\u4e3a\u201c\u672a\u52a0\u8f7d\u201d&#xff0c;\u5219\u52a0\u8f7d\u5b50\u8282\u70b9<br \/>\n \u00a0 \u00a0if (e.Node.Tag !&#061; null &amp;&amp; e.Node.Tag.ToString() &#061;&#061; &#034;unloaded&#034;)<br \/>\n \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u6a21\u62df\u4ece\u6570\u636e\u5e93\/\u6587\u4ef6\u7cfb\u7edf\u52a0\u8f7d\u5b50\u8282\u70b9<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0e.Node.Nodes.Add(&#034;\u62a5\u544a.docx&#034;);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0e.Node.Nodes.Add(&#034;\u6570\u636e.xlsx&#034;);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u6807\u8bb0\u4e3a\u5df2\u52a0\u8f7d<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0e.Node.Tag &#061; &#034;loaded&#034;;<br \/>\n \u00a0  }<br \/>\n}<\/p>\n<h4>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h4>\n<h5>1. \u8282\u70b9\u592a\u591a\u5bfc\u81f4\u52a0\u8f7d\u5361\u987f<\/h5>\n<ul>\n<li>\n<p>\u539f\u56e0&#xff1a;\u4e00\u6b21\u6027\u52a0\u8f7d\u5927\u91cf\u8282\u70b9&#xff08;\u5c24\u5176\u662f\u6df1\u5c42\u7ea7&#xff09;\u4f1a\u5360\u7528\u5927\u91cf\u5185\u5b58\u548c UI \u7ebf\u7a0b\u8d44\u6e90\u3002<\/p>\n<\/li>\n<li>\n<p>\u89e3\u51b3&#xff1a;\u91c7\u7528\u5ef6\u8fdf\u52a0\u8f7d&#xff08;\u89c1\u8fdb\u9636\u7528\u6cd5 4&#xff09;&#xff0c;\u4ec5\u5728\u8282\u70b9\u5c55\u5f00\u65f6\u52a0\u8f7d\u5b50\u8282\u70b9&#xff1b;\u6216\u4f7f\u7528\u865a\u62df\u6a21\u5f0f&#xff08;VirtualMode&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>2. \u65e0\u6cd5\u7f16\u8f91\u8282\u70b9\u6587\u672c<\/h5>\n<ul>\n<li>\n<p>\u539f\u56e0&#xff1a;\u9ed8\u8ba4AllowEdit &#061; false&#xff0c;\u6216\u672a\u89e6\u53d1\u7f16\u8f91\u6a21\u5f0f\u3002<\/p>\n<\/li>\n<li>\n<p>\u89e3\u51b3&#xff1a;\u8bbe\u7f6etreeView1.AllowEdit &#061; true&#xff0c;\u5e76\u901a\u8fc7node.BeginEdit()\u624b\u52a8\u89e6\u53d1\u7f16\u8f91&#xff08;\u5982\u53cc\u51fb\u8282\u70b9\u65f6&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>3. \u52fe\u9009\u7236\u8282\u70b9\u65f6\u81ea\u52a8\u52fe\u9009\u6240\u6709\u5b50\u8282\u70b9<\/h5>\n<ul>\n<li>\n<p>\u9700\u6c42&#xff1a;\u52fe\u9009\u7236\u8282\u70b9\u65f6&#xff0c;\u5176\u4e0b\u6240\u6709\u5b50\u8282\u70b9\u81ea\u52a8\u52fe\u9009&#xff1b;\u53d6\u6d88\u7236\u8282\u70b9\u52fe\u9009\u65f6&#xff0c;\u5b50\u8282\u70b9\u4e5f\u53d6\u6d88\u3002<\/p>\n<\/li>\n<li>\n<p>\u89e3\u51b3&#xff1a;\u5728AfterCheck\u4e8b\u4ef6\u4e2d\u9012\u5f52\u5904\u7406\u5b50\u8282\u70b9&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p>private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)<br \/>\n{<br \/>\n \u00a0 \u00a0\/\/ \u907f\u514d\u9012\u5f52\u89e6\u53d1\u6b7b\u5faa\u73af&#xff08;\u5224\u65ad\u662f\u5426\u4e3a\u7528\u6237\u64cd\u4f5c&#xff09;<br \/>\n \u00a0 \u00a0if (e.Action !&#061; TreeViewAction.Unknown)<br \/>\n \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u9012\u5f52\u8bbe\u7f6e\u5b50\u8282\u70b9\u7684\u52fe\u9009\u72b6\u6001<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0SetChildNodesCheckState(e.Node, e.Node.Checked);<br \/>\n \u00a0  }<br \/>\n}<br \/>\n\u200b<br \/>\n\/\/ \u9012\u5f52\u8bbe\u7f6e\u5b50\u8282\u70b9\u52fe\u9009\u72b6\u6001<br \/>\nprivate void SetChildNodesCheckState(TreeNode parentNode, bool isChecked)<br \/>\n{<br \/>\n \u00a0 \u00a0foreach (TreeNode childNode in parentNode.Nodes)<br \/>\n \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0childNode.Checked &#061; isChecked;<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u82e5\u6709\u5b50\u8282\u70b9&#xff0c;\u7ee7\u7eed\u9012\u5f52<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0if (childNode.Nodes.Count &gt; 0)<br \/>\n \u00a0 \u00a0 \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0SetChildNodesCheckState(childNode, isChecked);<br \/>\n \u00a0 \u00a0 \u00a0  }<br \/>\n \u00a0  }<br \/>\n}<\/p>\n<h5>4. \u62d6\u62fd\u8282\u70b9\u8c03\u6574\u5c42\u7ea7<\/h5>\n<ul>\n<li>\n<p>\u9700\u6c42&#xff1a;\u5141\u8bb8\u7528\u6237\u62d6\u62fd\u8282\u70b9\u5230\u5176\u4ed6\u8282\u70b9\u4e0b&#xff0c;\u8c03\u6574\u5c42\u7ea7\u7ed3\u6784\u3002<\/p>\n<\/li>\n<li>\n<p>\u89e3\u51b3&#xff1a;\u542f\u7528AllowDragDrop &#061; true&#xff0c;\u5e76\u5904\u7406ItemDrag\u3001DragEnter\u3001DragDrop\u4e8b\u4ef6&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p>\/\/ \u542f\u7528\u62d6\u62fd<br \/>\ntreeView1.AllowDragDrop &#061; true;<br \/>\n\u200b<br \/>\n\/\/ \u5f00\u59cb\u62d6\u62fd\u8282\u70b9<br \/>\nprivate void treeView1_ItemDrag(object sender, ItemDragEventArgs e)<br \/>\n{<br \/>\n \u00a0 \u00a0DoDragDrop(e.Item, DragDropEffects.Move); \/\/ \u5f00\u59cb\u62d6\u62fd<br \/>\n}<br \/>\n\u200b<br \/>\n\/\/ \u62d6\u62fd\u8fdb\u5165\u76ee\u6807\u8282\u70b9<br \/>\nprivate void treeView1_DragEnter(object sender, DragEventArgs e)<br \/>\n{<br \/>\n \u00a0 \u00a0e.Effect &#061; DragDropEffects.Move; \/\/ \u5141\u8bb8\u79fb\u52a8<br \/>\n}<br \/>\n\u200b<br \/>\n\/\/ \u5b8c\u6210\u62d6\u62fd&#xff08;\u8c03\u6574\u8282\u70b9\u5c42\u7ea7&#xff09;<br \/>\nprivate void treeView1_DragDrop(object sender, DragEventArgs e)<br \/>\n{<br \/>\n \u00a0 \u00a0\/\/ \u83b7\u53d6\u62d6\u62fd\u7684\u8282\u70b9\u548c\u76ee\u6807\u8282\u70b9<br \/>\n \u00a0 \u00a0TreeNode draggedNode &#061; e.Data.GetData(typeof(TreeNode)) as TreeNode;<br \/>\n \u00a0 \u00a0TreeNode targetNode &#061; treeView1.GetNodeAt(treeView1.PointToClient(new System.Drawing.Point(e.X, e.Y)));<br \/>\n\u200b<br \/>\n \u00a0 \u00a0\/\/ \u6821\u9a8c&#xff1a;\u4e0d\u80fd\u62d6\u62fd\u5230\u81ea\u8eab\u6216\u5b50\u8282\u70b9\u4e0b<br \/>\n \u00a0 \u00a0if (draggedNode !&#061; null &amp;&amp; targetNode !&#061; null &amp;&amp; draggedNode !&#061; targetNode &amp;&amp; !draggedNode.Nodes.Contains(targetNode))<br \/>\n \u00a0  {<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u4ece\u539f\u4f4d\u7f6e\u79fb\u9664&#xff0c;\u6dfb\u52a0\u5230\u76ee\u6807\u8282\u70b9\u4e0b<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0draggedNode.Remove();<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0targetNode.Nodes.Add(draggedNode);<br \/>\n \u00a0 \u00a0 \u00a0 \u00a0targetNode.Expand(); \/\/ \u5c55\u5f00\u76ee\u6807\u8282\u70b9<br \/>\n \u00a0  }<br \/>\n}<\/p>\n<h4>\u516d\u3001\u9002\u7528\u573a\u666f\u603b\u7ed3<\/h4>\n<table>\n<tr>\u573a\u666f\u7c7b\u578b\u5b9e\u73b0\u65b9\u5f0f\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>\u6587\u4ef6 \/ \u76ee\u5f55\u6d4f\u89c8\u5668<\/td>\n<td>\u7ed3\u5408\u5ef6\u8fdf\u52a0\u8f7d &#043; \u56fe\u6807\u8bbe\u7f6e<\/td>\n<td>\u6a21\u62df Windows \u8d44\u6e90\u7ba1\u7406\u5668\u7684\u76ee\u5f55\u7ed3\u6784<\/td>\n<\/tr>\n<tr>\n<td>\u7ec4\u7ec7\u67b6\u6784\u5c55\u793a<\/td>\n<td>\u591a\u7ea7\u8282\u70b9 &#043; \u590d\u9009\u6846&#xff08;\u6279\u91cf\u9009\u62e9\u90e8\u95e8&#xff09;<\/td>\n<td>\u516c\u53f8\u90e8\u95e8 &#8211; \u5458\u5de5\u5c42\u7ea7\u3001\u6743\u9650\u89d2\u8272\u6811<\/td>\n<\/tr>\n<tr>\n<td>\u5206\u7c7b\u83dc\u5355\u5bfc\u822a<\/td>\n<td>\u70b9\u51fb\u8282\u70b9\u89e6\u53d1\u4e8b\u4ef6&#xff08;\u52a0\u8f7d\u5bf9\u5e94\u5185\u5bb9&#xff09;<\/td>\n<td>\u8f6f\u4ef6\u5de6\u4fa7\u529f\u80fd\u5206\u7c7b\u6811\u3001\u5e2e\u52a9\u6587\u6863\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td>\u6811\u5f62\u6570\u636e\u7f16\u8f91<\/td>\n<td>\u53f3\u952e\u83dc\u5355 &#043; \u8282\u70b9\u7f16\u8f91<\/td>\n<td>\u81ea\u5b9a\u4e49\u5206\u7c7b\u7ba1\u7406&#xff08;\u6dfb\u52a0 \/ \u5220\u9664 \/ \u91cd\u547d\u540d\u5206\u7c7b&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u603b\u7ed3<\/h4>\n<p>TreeView\u662f\u5904\u7406\u5c42\u7ea7\u6570\u636e\u7684\u6838\u5fc3\u63a7\u4ef6&#xff0c;\u901a\u8fc7\u8282\u70b9\u7684\u7236\u5b50\u5173\u7cfb\u76f4\u89c2\u5448\u73b0\u6811\u5f62\u7ed3\u6784\u3002\u5176\u7075\u6d3b\u6027\u4f53\u73b0\u5728\u8282\u70b9\u7ba1\u7406\u3001\u6837\u5f0f\u5b9a\u5236\u548c\u4ea4\u4e92\u6269\u5c55\u4e0a&#xff0c;\u7ed3\u5408\u5ef6\u8fdf\u52a0\u8f7d\u3001\u590d\u9009\u6846\u3001\u53f3\u952e\u83dc\u5355\u7b49\u529f\u80fd&#xff0c;\u53ef\u6ee1\u8db3\u4ece\u7b80\u5355\u5c55\u793a\u5230\u590d\u6742\u7f16\u8f91\u7684\u5404\u7c7b\u573a\u666f\u3002\u4f7f\u7528\u65f6\u9700\u6ce8\u610f\u5927\u6570\u636e\u91cf\u4e0b\u7684\u6027\u80fd\u4f18\u5316&#xff08;\u5982\u5ef6\u8fdf\u52a0\u8f7d&#xff09;\u548c\u4ea4\u4e92\u903b\u8f91\u7684\u5408\u7406\u6027&#xff08;\u5982\u62d6\u62fd\u6821\u9a8c\u3001\u52fe\u9009\u8054\u52a8&#xff09;\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb73\u6b21\u3002\u6458\u8981\uff1aTreeView\u662fWinForm\u4e2d\u7528\u4e8e\u5c55\u793a\u5c42\u7ea7\u6570\u636e\u7684\u6838\u5fc3\u63a7\u4ef6\uff0c\u901a\u8fc7TreeNode\u8282\u70b9\u5f62\u6210\u7236\u5b50\u5173\u7cfb\u7ed3\u6784\u3002\u5b83\u5177\u6709\u8282\u70b9\u7ba1\u7406\u3001\u4ea4\u4e92\u63a7\u5236\u548c\u6837\u5f0f\u5b9a\u5236\u529f\u80fd\uff0c\u652f\u6301\u5c55\u5f00\/\u6298\u53e0\u3001\u9009\u62e9\u3001\u7f16\u8f91\u53ca\u62d6\u62fd\u64cd\u4f5c\u3002\u5178\u578b\u5e94\u7528\u5305\u62ec\u7ec4\u7ec7\u67b6\u6784\u5c55\u793a\uff08\u516c\u53f8-\u90e8\u95e8-\u5458\u5de5\uff09\u3001\u6587\u4ef6\u76ee\u5f55\u6811\u7b49\u3002\u5f00\u53d1\u65f6\u9700\u6ce8\u610f\uff1a1)\u901a\u8fc7ImageList\u8bbe\u7f6e\u8282\u70b9\u56fe\u6807\uff1b2)\u4f7f\u7528CheckBoxes\u5b9e\u73b0\u591a\u9009\uff1b3)\u91c7\u7528\u5ef6\u8fdf\u52a0\u8f7d\u4f18\u5316\u5927\u6570\u636e\u6027\u80fd\uff1b4)\u5904\u7406\u8282\u70b9\u62d6\u62fd\u65f6\u9700\u6821\u9a8c\u5c42\u7ea7\u5173\u7cfb\u3002\u8be5\u63a7\u4ef6\u7ed3\u5408\u53f3\u952e\u83dc\u5355\u3001\u4e8b\u4ef6\u5904\u7406\u7b49\u53ef\u5b9e\u73b0\u590d\u6742\u6811\u5f62\u6570\u636e\u7ba1\u7406\uff0c\u4f46\u9700\u6ce8\u610f\u6027\u80fd\u4f18\u5316\u548c\u4ea4\u4e92\u903b\u8f91\u7684\u5408\u7406\u6027\u3002<\/p>\n","protected":false},"author":2,"featured_media":51104,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,666,5035,149],"topic":[],"class_list":["post-51110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-microsoft","tag-treeview","tag-windows"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WinForm\u4e4bTreeView\u63a7\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/51110.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WinForm\u4e4bTreeView\u63a7\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb73\u6b21\u3002\u6458\u8981\uff1aTreeView\u662fWinForm\u4e2d\u7528\u4e8e\u5c55\u793a\u5c42\u7ea7\u6570\u636e\u7684\u6838\u5fc3\u63a7\u4ef6\uff0c\u901a\u8fc7TreeNode\u8282\u70b9\u5f62\u6210\u7236\u5b50\u5173\u7cfb\u7ed3\u6784\u3002\u5b83\u5177\u6709\u8282\u70b9\u7ba1\u7406\u3001\u4ea4\u4e92\u63a7\u5236\u548c\u6837\u5f0f\u5b9a\u5236\u529f\u80fd\uff0c\u652f\u6301\u5c55\u5f00\/\u6298\u53e0\u3001\u9009\u62e9\u3001\u7f16\u8f91\u53ca\u62d6\u62fd\u64cd\u4f5c\u3002\u5178\u578b\u5e94\u7528\u5305\u62ec\u7ec4\u7ec7\u67b6\u6784\u5c55\u793a\uff08\u516c\u53f8-\u90e8\u95e8-\u5458\u5de5\uff09\u3001\u6587\u4ef6\u76ee\u5f55\u6811\u7b49\u3002\u5f00\u53d1\u65f6\u9700\u6ce8\u610f\uff1a1)\u901a\u8fc7ImageList\u8bbe\u7f6e\u8282\u70b9\u56fe\u6807\uff1b2)\u4f7f\u7528CheckBoxes\u5b9e\u73b0\u591a\u9009\uff1b3)\u91c7\u7528\u5ef6\u8fdf\u52a0\u8f7d\u4f18\u5316\u5927\u6570\u636e\u6027\u80fd\uff1b4)\u5904\u7406\u8282\u70b9\u62d6\u62fd\u65f6\u9700\u6821\u9a8c\u5c42\u7ea7\u5173\u7cfb\u3002\u8be5\u63a7\u4ef6\u7ed3\u5408\u53f3\u952e\u83dc\u5355\u3001\u4e8b\u4ef6\u5904\u7406\u7b49\u53ef\u5b9e\u73b0\u590d\u6742\u6811\u5f62\u6570\u636e\u7ba1\u7406\uff0c\u4f46\u9700\u6ce8\u610f\u6027\u80fd\u4f18\u5316\u548c\u4ea4\u4e92\u903b\u8f91\u7684\u5408\u7406\u6027\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/51110.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T09:44:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810094432-68986a00d81fa.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51110.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/51110.html\",\"name\":\"WinForm\u4e4bTreeView\u63a7\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T09:44:37+00:00\",\"dateModified\":\"2025-08-10T09:44:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/51110.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/51110.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51110.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WinForm\u4e4bTreeView\u63a7\u4ef6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WinForm\u4e4bTreeView\u63a7\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/51110.html","og_locale":"zh_CN","og_type":"article","og_title":"WinForm\u4e4bTreeView\u63a7\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb73\u6b21\u3002\u6458\u8981\uff1aTreeView\u662fWinForm\u4e2d\u7528\u4e8e\u5c55\u793a\u5c42\u7ea7\u6570\u636e\u7684\u6838\u5fc3\u63a7\u4ef6\uff0c\u901a\u8fc7TreeNode\u8282\u70b9\u5f62\u6210\u7236\u5b50\u5173\u7cfb\u7ed3\u6784\u3002\u5b83\u5177\u6709\u8282\u70b9\u7ba1\u7406\u3001\u4ea4\u4e92\u63a7\u5236\u548c\u6837\u5f0f\u5b9a\u5236\u529f\u80fd\uff0c\u652f\u6301\u5c55\u5f00\/\u6298\u53e0\u3001\u9009\u62e9\u3001\u7f16\u8f91\u53ca\u62d6\u62fd\u64cd\u4f5c\u3002\u5178\u578b\u5e94\u7528\u5305\u62ec\u7ec4\u7ec7\u67b6\u6784\u5c55\u793a\uff08\u516c\u53f8-\u90e8\u95e8-\u5458\u5de5\uff09\u3001\u6587\u4ef6\u76ee\u5f55\u6811\u7b49\u3002\u5f00\u53d1\u65f6\u9700\u6ce8\u610f\uff1a1)\u901a\u8fc7ImageList\u8bbe\u7f6e\u8282\u70b9\u56fe\u6807\uff1b2)\u4f7f\u7528CheckBoxes\u5b9e\u73b0\u591a\u9009\uff1b3)\u91c7\u7528\u5ef6\u8fdf\u52a0\u8f7d\u4f18\u5316\u5927\u6570\u636e\u6027\u80fd\uff1b4)\u5904\u7406\u8282\u70b9\u62d6\u62fd\u65f6\u9700\u6821\u9a8c\u5c42\u7ea7\u5173\u7cfb\u3002\u8be5\u63a7\u4ef6\u7ed3\u5408\u53f3\u952e\u83dc\u5355\u3001\u4e8b\u4ef6\u5904\u7406\u7b49\u53ef\u5b9e\u73b0\u590d\u6742\u6811\u5f62\u6570\u636e\u7ba1\u7406\uff0c\u4f46\u9700\u6ce8\u610f\u6027\u80fd\u4f18\u5316\u548c\u4ea4\u4e92\u903b\u8f91\u7684\u5408\u7406\u6027\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/51110.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T09:44:37+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810094432-68986a00d81fa.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/51110.html","url":"https:\/\/www.wsisp.com\/helps\/51110.html","name":"WinForm\u4e4bTreeView\u63a7\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T09:44:37+00:00","dateModified":"2025-08-10T09:44:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/51110.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/51110.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/51110.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"WinForm\u4e4bTreeView\u63a7\u4ef6"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/51110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=51110"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/51110\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/51104"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=51110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=51110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=51110"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=51110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}