WPF APPLICATION

Jaya J

Total Post:9

Points:63
Posted by  Jaya J
C# 
 963  View(s)
Ratings:
Rate this:
Tell me the code for how to change font size of labels,buttons in wpf applications when screen resolutions was changed.i.e, when I'm using this wpf application in another system(the screen resolution for that system is different)how can i make change those labels, buttons sizes dynamically.

Please help me.
  1. John Smith

    Post:103

    Points:727
    Re: WPF APPLICATION

    Viewbox is quite useful:
    try following line of code

    <Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window" Height="400" Width="400">
    <Viewbox>
    <StackPanel>
    <TextBlock FontSize="16">Test</TextBlock>
    <Border Background="Aqua" Width="200" Height="200"></Border>
    </StackPanel>
    </Viewbox>
    </Window>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!