[C#] treeView 더블클릭 트리 펴지는거(Expand) 막기
bool treeCanExpand = false;
private void treeView_BeforeCollapse(object sender, TreeViewCancelEventArgs e)
{
if (treeCanExpand == true && e.Action == TreeViewAction.Collapse)
e.Cancel = true;
}
private void treeView_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
if (treeCanExpand == true && e.Action == TreeViewAction.Expand)
e.Cancel = true;
}
private void treeView_MouseDown(object sender, MouseEventArgs e)
{
if (e.Clicks > 1)
treeCanExpand = true;
else
treeCanExpand = false;
}
출처 : http://stackoverflow.com/questions/1249312/disable-expanding-after-doubleclick