by default wpf window having white color. so what color i should specify for background as a result it will look like normal window which is just like .net 2.0 win apps windows color. please help
Navigate to the Properties window, and click the Background drop-down arrow, and choose Red or another color in the color picker.
Here's how to change it to a different color theme. On the menu bar, select Tools > Options. In the options list, select Environment > General. In the Color theme list, choose between the default Dark theme, the Blue theme, the Blue (Extra Contrast) theme, and the Light theme.
You need to paint the background using a system color brush.
The SystemColors.ControlBrushKey
property will return the ResourceKey
for the appropriate SolidColorBrush
.
For example, to set the background of a button, you might use the following code:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowTitle="SystemColors Example" Background="White">
<StackPanel Margin="20">
<Button
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
Content="Hello, World!" />
</StackPanel>
</Page>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With