Window Bar Colours #27
-
|
Hi, this library is really great. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The header bar of an To change the background of the entire header, modify the dockpanel's background. To change the background of the exit button, modify the CloseButton's background: <Window xmlns="clr-namespace:MGUI.Core.UI.XAML;assembly=MGUI.Core"
xmlns:System="clr-namespace:System;assembly=System.Runtime"
SizeToContent="WidthAndHeight" MinWidth="200" MinHeight="200"
WindowStyle="Default" IsCloseButtonVisible="True" TitleText="Hello World">
<Window.TitleBar>
<DockPanel Background="Orange" />
</Window.TitleBar>
<Window.CloseButton>
<Button Background="Green" />
</Window.CloseButton>
</Window>Note: You can completely override the content of the title bar by adding content to the title bar dockpanel and setting <Window xmlns="clr-namespace:MGUI.Core.UI.XAML;assembly=MGUI.Core"
xmlns:System="clr-namespace:System;assembly=System.Runtime"
SizeToContent="WidthAndHeight" MinWidth="200" MinHeight="200"
WindowStyle="Default" IsCloseButtonVisible="false">
<Window.TitleBar>
<DockPanel Background="Crimson">
<StackPanel Orientation="Horizontal" Dock="Left">
<TextBlock Text="Foo:" VerticalAlignment="Center" />
<Spacer Width="5" />
<TextBox PlaceholderText="[i][opacity=0.5]enter a value[/opacity][/i]" Width="100" />
</StackPanel>
</DockPanel>
</Window.TitleBar>
</Window> |
Beta Was this translation helpful? Give feedback.
The header bar of an
MGWindowis controlled byMGWindow.TitleBarTextBlockElement(displays the text in the header),MGWindow.CloseButtonElement(displays the close button on the right side of the header), andMGWindow.TitleBarElement(theMGDockPanelcontainer that arranges the text block and the close button). (Note: In XAML, these properties are named slightly differently:TitleBarTextBlock,CloseButton, andTitleBar)To change the background of the entire header, modify the dockpanel's background. To change the background of the exit button, modify the CloseButton's background: