美文网首页
2019-03-26居中

2019-03-26居中

作者: 1f658716b568 | 来源:发表于2019-03-26 16:07 被阅读0次
    //解决窗体第一次设置为最大化后,点击最大化按钮窗体无法居中问题
    int x = Convert.ToInt32((Screen.PrimaryScreen.WorkingArea.Width - this.Width) * 0.5);
    int y = Convert.ToInt32((Screen.PrimaryScreen.WorkingArea.Height - this.Height) * 0.5);
    this.SetBounds(x, y, this.Width, this.Height, BoundsSpecified.All);
    

    C# winform解决解决窗体第一次设置为最大化后,点击最大化按钮窗体无法居中问题...

    相关文章

      网友评论

          本文标题:2019-03-26居中

          本文链接:https://www.haomeiwen.com/subject/gsfnvqtx.html