📅  最后修改于: 2022-03-11 14:49:00.092000             🧑  作者: Mango
//Add a BeforeSelect event to your TreeView (FormX.Designer.cs):
treeView1.BeforeSelect += new TreeViewCancelEventHandler(treeView1_BeforeSelect);
//And create a treeView1_BeforeSelect function (FormX.cs):
private void treeView1_BeforeSelect(object sender, TreeViewCancelEventArgs e)
{
e.Cancel = true;
}