控制dx窗体的大小及位置

2021-04-21 20:25

阅读:495

//控制默认窗体的高度和宽度

this.Height

this.Width

//控制默认窗体的位置

this.Top

this.Left

//设置为默认窗体,最大化窗体,最小化窗体

this.WindowState = FormWindowState.Normal;
this.WindowState = FormWindowState.Minimized;
this.WindowState = FormWindowState.Maximized;

 

Dome

  this.Height = 200;
  this.Width = 220;
  this.Top = 50;
  Rectangle ScreenArea = System.Windows.Forms.Screen.GetBounds(this);
  int Woswidth=ScreenArea.Width;
  this.Left = Woswidth-230;
  this.WindowState = FormWindowState.Normal;


评论


亲,登录后才可以留言!