Window position changes after Maximizing/Demaximizing

Ribbon for WPF Forum

Posted 12 years ago by Dietrich Birngruber
Version: 1.0.0330
Platform: .NET 3.0
Environment: Windows Vista (32-bit)
Avatar
If you put a RibbonWindow on the top edge of the screen and maximize the window, one would think that demaximizing the window would end up in the same position as before maximizing.

In fact, the window changes its position - I think it's the magic number of 28 pixels ;) - upwards. And in this case the window title bar disappears.

If you resize the window - even if only horizontally - the window title bar becomes visible again.

I also noticed, that when you change the size of a RibbonWindow by adding a pixel to the Width-Property, the window also grows in vertical direction by the magic 28 pixels.

private void fileNewCommand_Execute(object sender, ExecutedRoutedEventArgs e) {
    // Create a new document
    this.CurrentDocumentData = DocumentData.CreateNewDocument();
    RibbonWindow window = (RibbonWindow)ActiproSoftware.Windows.Media.VisualTreeHelperExtended.GetAncestor(this, typeof(RibbonWindow));
    if (window != null)
    {
        window.Width++;
    }
}
I think that this is an issue with the GlassEffect in Vista, as the effects don't occur when disabling glass.

best regards
Dietrich

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks Dietrich, I've spent some time on this and it's due to the non-client size calculation code. There are a lot of goofy things we have to do to get a glass effect background with a custom title (since normally Windows doesn't let you draw in the non-client area). I'll continue working on this.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.