none
Maximize Window according to Tak bar state RRS feed

  • Question

  • Dear all,

    I have an application wich start in normal state ( not maximized)

    Then user is free to maximize it using Maximize button.

    Issue I get is that, when he clck on maximized, my window cover the Windows Task bar when initialy visible

    How can I make my window occupy only working area when ( excluding task bar area when visible) through MVVm ?

    regarsd

    Monday, May 7, 2018 2:25 PM

Answers

  • Task bar settings is Set to Lock, and when I maximize my app window it cover the whole screen event th task bar. seems it is not taking in account the working screen area.

    inserting this line help

    this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;

    But if the user change tehtask bar setting to Auto hide, after windsow gets maximized, the window did not occupy all screen

    My scenario need to occupy all screen height based on task bar settings


    @wakefun

    You would need to manually detect the state of the Taskbar by some Win32 APIs. And then, you could set the height for your window.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by wakefun Tuesday, May 8, 2018 8:23 AM
    Tuesday, May 8, 2018 7:59 AM
    Moderator

All replies

  • Get the user to right click the taskbar then select TaskBar Settings.  There are a couple of "hide" taskbar options.  I have never had that problem and all the hide options are set to off.

    Lloyd Sheen

    Monday, May 7, 2018 9:59 PM
  • Hi wakefun,

    I agree with sqlguy’s suggestion. Please let your user check if he has do some custom settings for the taskbar.

    If it still did not work. You could try to set the MaxHeight property of that window to SystemParameters.MaximizedPrimaryScreenHeight in the constructor.

    public MainWindow() { InitializeComponent(); this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;

    }

    Best Regards,

    Xavier Xie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, May 8, 2018 6:51 AM
    Moderator
  • Task bar settings is Set to Lock, and when I maximize my app window it cover the whole screen event th task bar. seems it is not taking in account the working screen area.

    inserting this line help

    this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;

    But if the user change tehtask bar setting to Auto hide, after windsow gets maximized, the window did not occupy all screen

    My scenario need to occupy all screen height based on task bar settings


    • Edited by wakefun Tuesday, May 8, 2018 7:35 AM
    Tuesday, May 8, 2018 7:33 AM
  • Task bar settings is Set to Lock, and when I maximize my app window it cover the whole screen event th task bar. seems it is not taking in account the working screen area.

    inserting this line help

    this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;

    But if the user change tehtask bar setting to Auto hide, after windsow gets maximized, the window did not occupy all screen

    My scenario need to occupy all screen height based on task bar settings


    @wakefun

    You would need to manually detect the state of the Taskbar by some Win32 APIs. And then, you could set the height for your window.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by wakefun Tuesday, May 8, 2018 8:23 AM
    Tuesday, May 8, 2018 7:59 AM
    Moderator