一个小问题,怎么样让一个窗体打开后就在屏幕的正中间。

解决方案 »

  1.   

    设置窗体的StartUpPosition属性为 -2屏幕中心
      

  2.   

    将窗体的StartUpPosition属性置为2 - 屏幕中心
      

  3.   


      '让窗体居中
      X0 = Screen.Width
      Y0 = Screen.Height
      X0 = (X0 - Me.Width) / 2
      Y0 = (Y0 - Me.Height) / 2
      Me.Move X0, Y0
      

  4.   

    将窗体的StartUpPosition属性设为2 
      

  5.   

    设置窗体的StartUpPosition属性为 -2屏幕中心
      

  6.   

    StartUpPosition=2
    或者也可以用代码来实现,在form的load事件中加入
    me.top=(screen.height-me.height)/2
    me.left=(screen.width-me.width)/2
    就行了。
      

  7.   

    StartUpPosition=2
    或者也可以用代码来实现,在form的load事件中加入
    me.top=(screen.height-me.height)/2
    me.left=(screen.width-me.width)/2
    就行了。
      

  8.   

    在进行窗体属性设置时:
    将窗体的StartUpPosition属性置为2 - 屏幕中心或者
    在窗体的load事件中加入如下代码:
    me.top=(screen.height-me.height)/2
    me.left=(screen.width-me.width)/2亦可!