提出问题提出问题
 

已答复Window Client Size?

答案

  • 2007年9月21日 19: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日 17:33Marlon GrechMVP用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    what do you mean by Window client area??? is it te size of the window including the titlebar?
  • 2007年9月21日 19: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.