1 Form基类
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
using System.Reflection;
/// <summary>
/// 用法:
/// 1 新建Form窗体,继承BaseForm
/// 2 新Form添加panel, dock = fill;
/// 3 新Form load事件添加
/// </summary>
public class BaseForm : Form
{
#region 属性
double formWidth, formHeight;//初始化大小
double xScale, yScale;//缩?放比括例
//控?件t坐?标括,?大洙小?,?字?体?
Dictionary<string, string> controlInfo = new Dictionary<string, string>();
#endregion
#region 方?法
public void RemoveVirtualBorder(object obj)
{
Met
本文介绍了如何在C# Winform应用中实现控件根据屏幕大小自动缩放,确保在不同分辨率的显示器上都能获得良好的显示效果。通过自定义Form基类,实现窗口及控件的自动调整,从而达到屏幕适配的目的。
订阅专栏 解锁全文
1221

被折叠的 条评论
为什么被折叠?



