Kadir Ozgur
Kadir Ozgur

Reputation: 1

WPF change screen resolution in C#

I have a WPF Application and when I change my screen resolution to 800 X 600 or other smaller resolutions then, I can not see all my form. I see just up side of my form. How may I overcome this?

      <local:WorkControl x:Class="Mzaddress.AddressControl"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Mzaddress"
      Title="Adresse" mc:Ignorable="d" d:DesignWidth="840"    
      xmlns:r="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon" 
      Loaded="WorkControl_Loaded" x:Name="myCntl"
      FontFamily="Arial" FontSize="12" xmlns:my="clr-namespace:Mzaddress.UserControls" 
      VerticalAlignment="Top" VerticalContentAlignment="Stretch" 
      local:HelpProvider.HelpParameter="AddressControl">
      <local:WorkControl.Resources>

Upvotes: 0

Views: 822

Answers (1)

tobsen
tobsen

Reputation: 126

Try this little sample und put your form into such simple ScrollViewer.

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
              <Grid Height="600" Width="800" Background="Green"/>
</ScrollViewer>

Upvotes: 3

Related Questions