Reputation: 11
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" >
Upvotes: 0
Views: 66
Reputation: 5474
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;
Upvotes: 1