那个有将窗体一直置于最顶端的源代码(vb)撒 帮忙给小弟一下啊!

解决方案 »

  1.   

    Option Explicit
    Private Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
    Private Sub Form_Load()Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2 'centre the form on the screen SetWindowPos OnTop.hwnd, -1, 0, 0, 0, 0, 3End Sub
      

  2.   

    假设有两个窗体form1,form2,现在想要form2一直在form1的上面,并且不影响form1的操作。楼主是不是这个意思?
    如果是,在显示form2时:
    form2.show 0,form1
      

  3.   

    将此 Me.Zorder vbVringToFront 放在适当的事件中!
      

  4.   

    用SetWindowPosAPI函数,在最后一个参数中加入HWND_TOPMOST