Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Defect background

$
0
0

I have a problem with the background color of my WPF application.
Here's the code of MainWindow.

<Window x:Class="Sample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         Title="Project" Height="825" Width="1020"  MinWidth="400" MinHeight="400" Background="#333"       AllowsTransparency="True" WindowStyle="None"     ><Grid><Grid  Height="77"  VerticalAlignment="Top"       ><Button       FontFamily="Marlett" Content="r" FontSize="14"  HorizontalAlignment="Right" Margin="0,1,0,0" VerticalAlignment="Top" Width="23" Foreground="#FFFBF7F7" Click="Button_Click_1"></Button><StackPanel  Orientation="Horizontal"   HorizontalAlignment="Left" Height="20"  Margin="0,0,0,0" VerticalAlignment="Top"  ><Image Source="home.png"    Margin="0,0,5,0"    /><Label Content="Project"   Foreground="Lavender"  FontSize="17" Padding="5,0,5,0" VerticalAlignment="Top" Margin="0,2,0,0"  /></StackPanel></Grid></Grid></Window>

1- When I click on the icon of my application in the windows task bar, the application minimises,
2- In the second click, everything returns to normal.

Here is my problem

When I change the Height of the StackPanel which contains the logo and the fontsize of label . I have a defect in the background that appears when I click on the icon in the task bar.

<Window x:Class="Sample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         Title="Project" Height="825" Width="1020"  MinWidth="400" MinHeight="400" Background="#333"       AllowsTransparency="True" WindowStyle="None"     ><Grid><Grid  Height="77"  VerticalAlignment="Top"       ><Button       FontFamily="Marlett" Content="r" FontSize="14"  HorizontalAlignment="Right" Margin="0,1,0,0" VerticalAlignment="Top" Width="23" Foreground="#FFFBF7F7" Click="Button_Click_1"></Button><StackPanel  Orientation="Horizontal"   HorizontalAlignment="Left" Height="40"  Margin="0,0,0,0" VerticalAlignment="Top"  ><Image Source="home.png"    Margin="0,0,5,0"    /><Label Content="Project"   Foreground="Lavender"  FontSize="34" Padding="5,0,5,0" VerticalAlignment="Top" Margin="0,2,0,0"  /></StackPanel></Grid></Grid></Window>

I do not understand this defect.
To better understabd my issue, please try these 2 codes above from your side and help me to solve it..

Many thanks



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>