Search code examples
c#wpfxamlthemesribboncontrolslibrary

WPF RibbonWindow Minimize, Maximize / Restore, and Close Buttons Not Visible


So I've googled all day trying to find an answer and have come up short. I've found stuff close and maybe even found a solution and just didn't realized it but I cant seem to get the Minimize, Maximize / Restore, and Close buttons to show up (be visible) on my windows 10 machine. No one but myself and another developer who just got new laptops have this issue. I've tried changing my windows theme around and I did get them to show up with I turned some high contrast setting on but no luck otherwise. Despite not being visible they are there and functional because I can click in the area and see the window min, max, restore, close.

We are using .Net 4.0 and a RibbonWindow with a custom theme (BureauBlue.xaml). I'd like to believe it may have something to do with that but I don't know anything about it or where to start unfortunately.

enter image description here

<r:RibbonWindow x:Class="Ztools.Main" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                xmlns:props="clr-namespace:Ztools.Properties" 
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" 
                IsTabStop="False" Icon="/Ztools;component/ztools32.ico" Height="830" Width="1200"                         WindowStartupLocation="CenterScreen" WindowState="Normal" 
                Loaded="RibbonWindow_Loaded" Closing="RibbonWindow_Closing"
                xmlns:my="clr-namespace:System;assembly=mscorlib" Title="Ztools 2.0" Name="mainRibbon"                   FontSize="14" SizeChanged="mainRibbon_SizeChanged"                                                       LocationChanged="mainRibbon_LocationChanged" 
                StateChanged="mainRibbon_StateChanged" Deactivated="mainRibbon_Deactivated"                               KeyUp="mainRibbon_KeyUp" Background="{x:Null}">
      <r:RibbonWindow.Resources>
          <ResourceDictionary>
              <ResourceDictionary.MergedDictionaries>
                  <ResourceDictionary Source="/Ztools;component/themes/bureaublue.xaml"/>
              </ResourceDictionary.MergedDictionaries>
          </ResourceDictionary>
      </r:RibbonWindow.Resources>
</r:RibbonWindow>

Another thing I noticed but haven't verified by pulling out my old laptop yet is I'm pretty sure the nice looking buttons showed up at design time as well and didn't look like this. enter image description here

Bonus question/issue is sometimes when our computers go to sleep/hibernate go from docking station to no station (not sure which one or both) the theme bar will also randomly black out like this. If I could look at fixing this at the same time that would be great.

enter image description here I did change it to a normal Window and was able to see all the buttons correctly but I guess I'd rather not go that route and know what the issue is and solve it.

Any thoughts ideas or suggestions are greatly appreciated.

Edit: So I don't think it has anything to do with the theme? I commented out everything having to do with the theme and they still don't show up... Not sure why I didn't take that simple step a long time ago.


Solution

  • So going to post this again that way anyone with the same or similar issue can at least have an option to fixing their issue... since for some reason it was deleted despite containing valuable information as an alternative solution to the problem.

    For now I changed it from a RibbonWindow to a Window an gave my Ribbon a margin of 0,-22,0,0 so things line up and look decent as suggested by a number of other SO posts. The buttons show up now, but aren't the RibbonWindow style so is what it is.

    <Window x:Class="Ztools.Main" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                    xmlns:props="clr-namespace:Ztools.Properties" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" 
                    IsTabStop="False" Icon="/Ztools;component/ztools32.ico" Height="830" Width="1200" WindowStartupLocation="CenterScreen" WindowState="Normal" 
                    Loaded="RibbonWindow_Loaded" Closing="RibbonWindow_Closing"
                    xmlns:my="clr-namespace:System;assembly=mscorlib" Title="Ztools 2.0" Name="mainRibbon" FontSize="14" SizeChanged="mainRibbon_SizeChanged" LocationChanged="mainRibbon_LocationChanged" StateChanged="mainRibbon_StateChanged" Deactivated="mainRibbon_Deactivated" KeyUp="mainRibbon_KeyUp">
    
       <r:Ribbon Title="Ztools 2.0 (Scale Configuration Editor)" IsTabStop="False" Background="#FFE5E5E5" FontSize="12" FontFamily="Arial" Margin="0,-22,0,0">
       </r:Ribbon>
    </Window>