winform 字体及窗体大小设置

设置字体大小: 

Font font=new Font(textBox1.Font.FontFamily, float.Parse(textBox1.Text), textBox1.Font.Style);

Font font=new Font("黑体",15);

获取显示器屏幕大小:

int xWidth = SystemInformation.PrimaryMonitorSize.Width;//获取显示器屏幕宽度

int yHeight = SystemInformation.PrimaryMonitorSize.Height;//高度

设置窗体大小:
this.StartPosition = FormStartPosition.Manual;
this.Width =(xWidth/3)*1;
this.Height = yHeight;
Globals.ThisAddIn.Application.WindowState = Microsoft.Office.Interop.PowerPoint.PpWindowState.ppWindowNormal;
Globals.ThisAddIn.Application.Top = 0;
Globals.ThisAddIn.Application.Left= 0;
Globals.ThisAddIn.Application.Width =600;
Globals.ThisAddIn.Application.Height = yHeight;

 设置窗体相对桌面位置

this.SetDesktopLocation(xWidth - (xWidth / 3) * 1, 0);

原文地址:https://www.cnblogs.com/feuji/p/2795554.html