I have a simple Window that i would like to have a 100% width. I tried the "Stretch" property for Horizontal alignement but width is still stuck to 768.
<Window x:Class="WPF.View.MetroMsgBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MetroMsgBox" ShowInTaskbar="True"
WindowStyle="None" ResizeMode="NoResize"
FontFamily="Segoe UI" Background="{x:Null}"
AllowsTransparency="True"
Height="135" WindowStartupLocation="CenterScreen"
Deactivated="MetroMsgBox_OnDeactivated" HorizontalAlignment="Stretch" >
Hi could you just try that :
<Window x:Class="WPF.View.MetroMsgBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MetroMsgBox" ShowInTaskbar="True"
Name=_window
WindowStyle="None" ResizeMode="NoResize"
FontFamily="Segoe UI" Background="{x:Null}"
AllowsTransparency="True"
Height="135" WindowStartupLocation="CenterScreen"
Deactivated="MetroMsgBox_OnDeactivated" HorizontalAlignment="Stretch" >
InitializeComponent();
_window.Width = Screen.PrimaryScreen.Bounds.Width;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.