차일드 컨트롤들의 열거...

Program/C# 2008. 2. 29. 14:27
< 환경 : WPF 프로젝, VS2008 >

WPF 윈도우 내의 그리드에 네임을 붙혀주고.. 해당 그리드의 칠드런에 접근하면 된다..
아래는 다수의 콤보박스의 크기를 일정하게 해주는 작업이고...
콤보박스의 이름이 "cbPost" 인 것은 제외 시킨다.

foreach (UIElement Combo in this.PageSettingGrid.Children )
            {
                if (Combo is ComboBox)
                {
                    if ((Combo as ComboBox).Name != "cbPost")
                    {
                        (Combo as ComboBox).SelectedIndex = 0;
                       
                        (Combo as ComboBox).Width = 40;
                        (Combo as ComboBox).Height = 20;
                    }
                }
            }

'Program > C#' 카테고리의 다른 글

클래스의 XML 문서화.  (0) 2008.03.05
전역 변수, Properties  (0) 2008.02.29
Num foramt 숫자의 출력 형식  (0) 2008.02.29
: