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
'▩▩ 프로그래밍 ▩▩ > C#' 카테고리의 다른 글
| [C#] Combobox --> ReadOnly 만들기 (0) | 2013.10.28 |
|---|---|
| [C#] byte[] --> string / string --> byte[] (0) | 2013.10.16 |
| [C#] Delegate, 자식 폼에게서 값 받기 (2) | 2013.10.11 |
| [C#] OpenFileDialog, SaveFileDialog (0) | 2013.10.11 |
| [C#] DataGridView 값 접근 (0) | 2013.10.07 |
| [C#] 개체 참조가 개체의 인스턴스로 설정되지 않았습니다. (0) | 2013.10.07 |
| [C#] XML 다루기 (0) | 2013.09.30 |
| [C#] 날짜 계산 (0) | 2013.09.30 |
![[나크21] 캐주얼 미니스커트 치마바지 NK21-P-10](https://image13.coupangcdn.com/image/affiliate/banner/a0874210c3b8ced08e8de1985ebfb8c9@2x.jpg)

