自动缩放功能使窗体及其控件可以在一台设有特定显示分辨率或字体的计算机上设计后,能够在另一台具有不同显示分辨率或字体的计算机上正确显示。 它确保窗体及其控件可智能调整大小,使其与用户和其他开发人员计算机上的本机窗口和其他应用程序保持一致。 自动缩放和视觉样式使 Windows 窗体应用程序能够与每个用户计算机上的本...
在显示窗体之前,调用ApplyAutoScaling方法来缩放窗体。 此方法计算AutoScaleBaseSize和Font的相对缩放大小,然后调用Scale方法来实际缩放窗体及其子窗体。 更新了AutoScaleBaseSize的值,以便对ApplyAutoScaling的后续调用不会导致窗体不断调整大小。 虽然此机制足以满足大多数目的,但存在以下限制: ...
Automatic scaling was implemented in only the Form class, not in the ContainerControl class. As a result, user controls would scale correctly only when the user control was designed at the same resolution as the form, and it was placed in the form at design time. Forms and their child con...
Use the ApplyAutoScaling method instead. https://go.microsoft.com/fwlink/?linkid=14202 根据AutoScaleBaseSize 属性的当前值和当前字体的大小来调整窗体大小。 C# 复制 [System.Obsolete("This method has been deprecated. Use the ApplyAutoScaling method instead. https://go.microsoft.com/fwlink/?link...
System.Windows.Forms 組件: System.Windows.Forms.dll 來源: ToolStripItemImageScaling.cs 指定ToolStripItem上的影像大小是否會自動調整,以便容納在ToolStrip上,同時保留原始的影像比例。 C# publicenumToolStripItemImageScaling 繼承 Object ValueType Enum
Automatic scaling enables a form and its controls, designed on one machine with a certain display resolution or font, to be displayed appropriately on another machine with a different display resolution or font. It assures that the form and its controls will intelligently resize to be consistent ...
Windows Forms applications that implement their own scaling logic for high DPI settings may encounter unusual scaling if these applications are opted into the Microsoft .NET Framework 4.5.2 High DPI changes by using the following .config file setting: ...
与WPF 元素不同,大多数 Windows 窗体控件不可持续缩放。 若要提供自定义缩放,请重写WindowsFormsHost.ScaleChild方法。 若要使用默认行为缩放托管控件,请执行以下步骤: 将以下 XAML 复制到Grid元素中: XAML <!-- Scaling transformation. --><StackPanelGrid.Row="0"Grid.Column="2"><StackPanel.RenderTransform>...
Windows Forms applications that implement their own scaling logic for high DPI settings may encounter unusual scaling if these applications are opted into the Microsoft .NET Framework 4.5.2 High DPI changes by using the following .config file setting: ...
System.Windows.Forms 組件: System.Windows.Forms.dll 來源: ToolStripControlHost.cs 這個屬性與這個類別無關。 C# [System.ComponentModel.Browsable(false)]publicSystem.Windows.Forms.ToolStripItemImageScaling ImageScaling {get;set; } 屬性值 ToolStripItemImageScaling ...