把一个窗体显示在屏幕的中心用什么API函数。

解决方案 »

  1.   

    form1.move (screen.width-width)/2,(screen.height-height)/2
      

  2.   

    form1.move (screen.width-width)/2,(screen.height-height)/2
      

  3.   

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

  4.   

    无相关api函数,只能自定义。如下:'-----------------------------------------------------------
    ' SUB: CenterForm
    ' 居中传递过来的窗体,在屏幕中心的上面
    '-----------------------------------------------------------
    Public Sub CenterForm(frm As Form)
        frm.Top = Screen.Height \ 2 - frm.Height \ 2 
        frm.Left = Screen.Width \ 2 - frm.Width \ 2
    End Sub
      

  5.   

    这只是平面解析几何问题,不是编程问题,更不是Win32 API问题