How do I get the title bar to be darker? #7623
-
I cannot get the title bar darker than #595959 as you see in the picture below. How can I make it the same color as my background? Can't seem to find any good resources on this. Here's my XAML <Window
x:Class="Powertoys.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Powertoys"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid
Background="#303030">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="Auto" />
<ColumnDefinition
Width="*" />
</Grid.ColumnDefinitions>
<Border
x:Name="AppTitleBar"
Grid.Column="1"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
IsHitTestVisible="True"
Canvas.ZIndex="1"
>
<TextBlock
x:Name="AppTitle"
Text="{StaticResource AppTitleName}"
VerticalAlignment="Center"
TextAlignment="Start"
Margin="10, 10, 10, 10"
/>
</Border>
</Grid>
</Window> An my C# code public sealed partial class MainWindow : Window {
public MainWindow() {
this.InitializeComponent();
this.ExtendsContentIntoTitleBar = true;
this.SetTitleBar(AppTitleBar);
}
} Expected result: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can change the Opacity like I did in App.xaml in the test sample I had posted (WinUI3_CustomCaption)
in MainWindow.xaml, |
Beta Was this translation helpful? Give feedback.
-
set this to App.xaml
full code
|
Beta Was this translation helpful? Give feedback.
set this to App.xaml
full code