public static Control FindFocusedControl(Control container) { foreach (Control childControl in container.Controls) { if (childControl.Focused) { return childControl; } } foreach (Control childControl in container.Controls) { Control maybeFocusedControl = FindFocusedControl(childControl); if (maybeFocusedControl != null) { return maybeFocusedControl; } } return null; // Couldn't find any, darn! }
'프로그래밍 > .NET' 카테고리의 다른 글
[C#] MySQL 사용 (0) | 2013.01.29 |
---|---|
[C#] HTTP/HTTPS 송수신 (HttpWebRequest/HttpWebResponse) (2) | 2013.01.18 |
ToolStriptButton Image Size(이미지 사이즈) 원본 크기로 들고오기 (0) | 2012.12.21 |
Monitor Class (0) | 2012.10.29 |
ListView Column 클릭시 정렬 (0) | 2012.10.25 |