c#winform窗口启动位置设置--中心位置

 

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 WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
this.StartPosition = FormStartPosition.CenterScreen;  //添加在构造函数里面
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}
}
}

posted @ 2024-01-14 21:52  txwtech  阅读(120)  评论(1编辑  收藏  举报