2

WPF beginner here. I'm trying to mimic the font style used in Visual Studio 2010 for menus. Under Windows XP menus look blurry.

screenshot

How can my code be changed to get the same result?

<Window x:Class="Test_WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="480" Width="640">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Menu IsMainMenu="True">
            <MenuItem Header="_File" />
            <MenuItem Header="_Edit" />
            <MenuItem Header="_View" />
            <MenuItem Header="_Window" />
            <MenuItem Header="_Help" />
        </Menu>
    </Grid>
</Window>
Community
  • 1
  • 1
Frank Ross
  • 349
  • 1
  • 7
  • 16
  • possible duplicate of [WPF Blurry fonts problem - Solutions](http://stackoverflow.com/questions/190344/wpf-blurry-fonts-problem-solutions) – Joey Jan 19 '12 at 19:07
  • 1
    @Joey: Indeed. The answer of Helge Klein is the one that I was looking for. Unfortunately it's not the top answer. – Frank Ross Jan 19 '12 at 20:41

2 Answers2

3

Play around with the following parameters for your Window:

    <Window x:Class="Test_WPF.MainWindow"
           ....
    UseLayoutRounding="True"
    TextOptions.TextFormattingMode="Display"
    TextOptions.TextRenderingMode="ClearType">
thumbmunkeys
  • 20,606
  • 8
  • 62
  • 110
0

In my case, the blurring was caused by a DropShadowEffect applied on a wrapped Grid. Removing this effect makes the blur issue disappear.

Matteo Gariglio
  • 482
  • 5
  • 12