질문하기질문하기
 

답변됨Window Client Size?

답변

  • 2007년 9월 21일 금요일 오후 7:29Hua Wang - MSFT 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    You can get the client size via the the window visual tree root’s ActualWidth/Height, e.g,

     

    FrameworkElement f =  VisualTreeHelper.GetChild(window, 0) as FrameworkElement;

    f.ActualWidth/Height

     

    In Window’s default style, the visual tree root is a Border.

     

    If your content is FrameworkElement and its layout behavior is sized to container, you can get the ActualWidth/Height directly of window.Content.

모든 응답

  • 2007년 9월 21일 금요일 오후 5:33Marlon GrechMVP사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    what do you mean by Window client area??? is it te size of the window including the titlebar?
  • 2007년 9월 21일 금요일 오후 7:29Hua Wang - MSFT 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    You can get the client size via the the window visual tree root’s ActualWidth/Height, e.g,

     

    FrameworkElement f =  VisualTreeHelper.GetChild(window, 0) as FrameworkElement;

    f.ActualWidth/Height

     

    In Window’s default style, the visual tree root is a Border.

     

    If your content is FrameworkElement and its layout behavior is sized to container, you can get the ActualWidth/Height directly of window.Content.