Skip to main content

Microsoft Silverlight

Answered Question Silverlight -> Verdana is not the same as Windows Form -> Verdana ?RSS Feed

(0)

Silverlight Web Developer
Silverli...

Member

Member

76 points

313 Posts

Silverlight -> Verdana is not the same as Windows Form -> Verdana ?

This might be a small detail but when it comes to Fonts on and in controls it is quite sensitive.

I have put this textBox like this:

<TextBox Height="20" Width="160" Text="SomeText" TextWrapping="Wrap" Canvas.Top="36" Canvas.Left="12" x:Name="GroupName" FontFamily="Verdana" FontSize="11.4" d:IsStaticText="True" Margin="0,0,0,0"/>

 

The standard Height for a textBox in Windows Forms is 20. When I put this height like above, the "SomeText" in the textBox isn´t excactly in the middle of the textbox. The text is a little bit down wich looks a little weird.

The thing is that I dont want to make the textBox Height larger to compensate for this as it will be to high.

Also when comparing the Same font "Verdana" from Windows Form and Silverlights Verdana, the font differ, it does not look the same. It is much more "clearer" in the Windows Form and in silverlight it looks "Crispy" and not very clear.

I wonder for both these things that is happening. I am doing an application and is very dependent that a user will recognice the environment from Windows Forms.

SharpGIS
SharpGIS

Contributor

Contributor

3387 points

611 Posts

Answered Question

Re: Silverlight -> Verdana is not the same as Windows Form -> Verdana ?

Don't set the height. The height should then automatically fit to the contents.
The different layout is because Silverlight does subpixel rendering. Windows form cannot do this.

--
/Morten | blog - twitter
Please click on "Mark as Answer" if this answered your question.

Silverlight Web Developer
Silverli...

Member

Member

76 points

313 Posts

Re: Silverlight -> Verdana is not the same as Windows Form -> Verdana ?

Thanks ShapGIS,

Then I understand. I took the height away and it adjusted as you said.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities