繁体   English   中英

WPF在C#中更改屏幕分辨率

[英]WPF change screen resolution in C#

我有一个WPF应用程序,然后将屏幕分辨率更改为800 X 600或其他较小的分辨率时,看不到所有表格。 我看到表格的正上方。 我该如何克服?

      <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>

试试这个小示例,然后将表单放入如此简单的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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM