去掉移动窗体时显示的虚线框,在移动窗体时,不管是有边框的窗体也好,没边框的窗体也好,移动时都会显示虚线框,而移动的是虚线框,松开鼠标后,窗体才移动到虚线框的位置,如何去掉虚线框,并且直接移动的是窗体,而不是虚线框?

解决方案 »

  1.   

    Option Explicit
    '直接拖动窗体例子
    'BY 嗷嗷叫的老马Dim mX As Long, mY As LongPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button And vbLeftButton Then
            mX = X: mY = Y
        End If
    End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button And vbLeftButton Then
            Me.Move Me.Left - mX + X, Me.Top - mY + Y
        End If
    End Sub是这效果?
      

  2.   

    三楼一句话,胜我读十年书。
    CSDN真是人间仙境呀,各路神仙大荟萃!