Danny
Danny

Reputation: 1

Why is Some Text Bold?

So I'm building a WPF installer and I have two radio buttons, for installing and uninstalling:

Radio buttons

Here is the XAML for each button, just for reference:

Install button:

<RadioButton Content="Install" HorizontalAlignment="Left" 
    Margin="42,90,0,0" VerticalAlignment="Top" FontSize="18" 
    RenderTransformOrigin="0.591,2.133" FontFamily="Microsoft Sans Serif"/>

Uninstall button:

<RadioButton Content="Uninstall" HorizontalAlignment="Left" 
    Margin="42,138,0,0" VerticalAlignment="Top" FontSize="18" 
    RenderTransformOrigin="0.591,2.133" FontFamily="Microsoft Sans Serif"/>

Now as you can see from the code, the buttons are basically the same, except for one says install, the other says uninstall, and their positioning is different. However, when the program is run, I get this result:

Install and Uninstall buttons in action

Any ideas as to why it is making the uninstall button bold, and how I can fix this?

EDIT: Here's the entire code for the program if you're interested. I hadn't gotten very far in before I noticed this problem:

<Window x:Class="Installer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Installer"
        mc:Ignorable="d"
        Title="Tic-Tac-Toe Installer" Height="283.159" Width="529.765">
    <Grid Margin="0,0,2,2">
        <RadioButton Content="Install" HorizontalAlignment="Left" Margin="42,90,0,0" VerticalAlignment="Top" FontSize="18" RenderTransformOrigin="0.591,2.133" FontFamily="Microsoft Sans Serif"/>
        <Label Content="Please select to install or uninstall Tic-Tac-Toe." Margin="27,23,-75,0" VerticalAlignment="Top" FontFamily="Microsoft Sans Serif" FontSize="22" Width="475" HorizontalAlignment="Left"/>
        <Button Content="Cancel" HorizontalAlignment="Left" Height="28" Margin="427,214,-60,-37" VerticalAlignment="Top" Width="75" FontFamily="Microsoft Sans Serif" FontSize="16"/>
        <Button Content="Next" HorizontalAlignment="Left" Height="28" Margin="331,214,0,0" VerticalAlignment="Top" Width="75" FontFamily="Microsoft Sans Serif" FontSize="16" RenderTransformOrigin="-0.734,0.499"/>
        <RadioButton Content="Uninstall" HorizontalAlignment="Left" Margin="42,138,0,0" VerticalAlignment="Top" FontSize="18" RenderTransformOrigin="0.591,2.133" FontFamily="Microsoft Sans Serif"/>

    </Grid>
</Window>

And here's the outcome:

Full display

Now, you may notice, that in this image, all of the text is bold. Whereas before, only the title ("Please select to install or uninstall Tic-Tac-Toe") and the Uninstall text was bold, but I haven't changed anything!

Upvotes: 0

Views: 81

Answers (1)

Emond
Emond

Reputation: 50672

The text is not bold. Its size is just larger than we are used to in UIs.

To make the text regular size remove the FontSize attributes completely.

Upvotes: 2

Related Questions