Formular una preguntaFormular una pregunta
 

RespondidaWindow Client Size?

Respuestas

  • viernes, 21 de septiembre de 2007 19:29Hua Wang - MSFT Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida

    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.

Todas las respuestas

  • viernes, 21 de septiembre de 2007 17:33Marlon GrechMVPMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    what do you mean by Window client area??? is it te size of the window including the titlebar?
  • viernes, 21 de septiembre de 2007 19:29Hua Wang - MSFT Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida

    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.