Revit二次开发 --窗体位置设置

public partial class VersionCheckingForm : Form
{
    public VersionCheckingForm()
    {
        InitializeComponent();
     }
    private void VersionCheckingForm_Load(object sender, EventArgs e)
    {
        SetDialogLocation();
    }
    private void SetDialogLocation()
    {
        int left = (Screen.PrimaryScreen.WorkingArea.Right - this.Width) / 2;
        int top = (Screen.PrimaryScreen.WorkingArea.Bottom - this.Height) / 2;
        Point windowLocation = new Point(left, top);
        this.Location = windowLocation;
    }
}

猜你喜欢

转载自blog.csdn.net/qq_43026206/article/details/86597134