非客户区修改使用Handy Control比较好,使用MarterialDesign反倒麻烦
1.修改右侧三个按钮前后颜色
hc:CloseButtonBackground="Blue"
hc:CloseButtonForeground="Yellow"
hc:NonClientAreaBackground="LightBlue"
hc:ShowTitle="False"
Topmost="True"
hc:OtherButtonBackground="Red"
hc:OtherButtonForeground="Green"
2.修改非客户区的颜色
<hc:Window.NonClientAreaContent >
<!--<DockPanel >-->
<Border MouseDown="Border_MouseDown" > //需要在c中添加拖动命令
<Border.Background >
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0" Color="#FF7CB3CC"></GradientStop>
<GradientStop Offset="1" Color="#FF0370A1"></GradientStop>
</LinearGradientBrush>
</Border.Background>
3.添加控件
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" DockPanel.Dock="Right" >
<TextBlock Text="用户" Margin="5,0,0,0"/>
<TextBlock Text="VIP " Margin="5,0,0,0" />
<TextBlock Text="帮助 " Margin="5,0,0,0 "/>
<!--</StackPanel>-->
<!--<StackPanel VerticalAlignment="Center" Orientation="Horizontal" >-->
<TextBlock Text="文件 " Margin="5,0,0,0"/>
<TextBlock Text="编辑 " Margin="5,0,0,0" />
<TextBlock Text="选择 " Margin="5,0,0,0 "/>
<TextBlock Text="查看 " Margin="5,0,0,0" />
<TextBlock Text="转到 " Margin="5,0,0,0" />
<TextBlock Text="运行 "/>
<Button Content="33" Background="Green"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="标 题"/>
</StackPanel>
</Border>
<!--</DockPanel>-->
</hc:Window.NonClientAreaContent>
4.在c程序中添加如下内容以便拖动窗体
private void Border_MouseDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}