ui适配调整 权限管理调整 上传数量调整
This commit is contained in:
1 parent
edb79b9abf
commit
deb84144cf
82 files changed
+1026
-485
No files matched your search
@@ -0,0 +1,51 @@
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TemuKJD.KJDForms.BaseForms
|
||||
{
|
||||
public partial class BaseForm : Form
|
||||
{
|
||||
public BaseForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void BaseForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
using (Graphics graphics = Graphics.FromHwnd(IntPtr.Zero))
|
||||
{
|
||||
float dpi = graphics.DpiX;
|
||||
// 或者使用 graphics.DpiY 获取垂直方向的DPI
|
||||
// float dpi = graphics.DpiY;
|
||||
// Console.WriteLine("Screen DPI: " + dpi); // winform程序会闪退
|
||||
|
||||
SetFont(this, dpi);
|
||||
}
|
||||
}
|
||||
|
||||
void SetFont(Control control, float dpi)
|
||||
{
|
||||
foreach (Control c in control.Controls)
|
||||
{
|
||||
SetFont(c, dpi);
|
||||
|
||||
Font of = c.Font;
|
||||
Font f = new Font(of.FontFamily, (of.Size * 96.0 / dpi).ParseToFloat(), of.Style, Font.Unit, Font.GdiCharSet, Font.Bold);
|
||||
c.Font = f;
|
||||
|
||||
if (c is DataGridView)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user