|
|
|
|
|
Dicas
|
|
Visual Basic (Forms/MDI)
|
|
|
Título da Dica: Movendo formulário sem barra de título
|
|
|
|
Postada em 23/7/2003 por Tekki
'Você pode usar o .BorderStyle = 0 ou não.
'Declare estas variáveis Public fMoveForm As Form Dim VarG_MouseX As Long, VarG_MouseY As Long
Private Sub Form_Load() Set fMoveForm = Me End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then VarG_MouseX = X VarG_MouseY = Y End If End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If (Button = 1) And (fMoveForm.WindowState <> 2) Then Screen.ActiveForm.Left = Screen.ActiveForm.Left + X - VarG_MouseX Screen.ActiveForm.Top = Screen.ActiveForm.Top + Y - VarG_MouseY End If End Sub
|
|
|
|
|