Hola de nuevo, Alguien sabe como mover un form tomandolo de cualquier parte, En 6.0 era creo que con ReleaseCapture, gracias de antemano!!
Hola de nuevo, Alguien sabe como mover un form tomandolo de cualquier parte, En 6.0 era creo que con ReleaseCapture, gracias de antemano!!
Gracias. ya la encontre con el guille, lo dejo por si le sirve a alguien
Imports System
Imports System.Windows.Forms
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Código generado por el Diseñador de Windows Forms "
' ... código del diseñador de Windows (no mostrado)
#End Region
'
' Declaraciones del API de Windows (y constantes usadas para mover el form)
'
Private Const WM_SYSCOMMAND As Integer = &H112&
Private Const MOUSE_MOVE As Integer = &HF012&
'
'' Declaraciones "clásicas" de VB6
'Private Declare Function ReleaseCapture Lib "user32" () As Integer
'Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
' (ByVal hWnd As System.IntPtr, ByVal wMsg As Integer, _
' ByVal wParam As Integer, ByVal lParam As Integer) As Integer
'
' Declaraciones del API al estilo .NET
<System.Runtime.InteropServices.DllImport("user32. DLL", EntryPoint:="ReleaseCapture")> _
Private Shared Sub ReleaseCapture()
End Sub
'
<System.Runtime.InteropServices.DllImport("user32. DLL", EntryPoint:="SendMessage")> _
Private Shared Sub SendMessage( _
ByVal hWnd As System.IntPtr, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByVal lParam As Integer _
)
End Sub
'
' función privada usada para mover el formulario actual
Private Sub moverForm()
ReleaseCapture()
SendMessage(Me.Handle, WM_SYSCOMMAND, MOUSE_MOVE, 0)
End Sub
'
Private Sub btnCerrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCerrar.Click
Me.Close()
End Sub
'
' podemos usar el mismo procedimiento de evento para mover
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles MyBase.MouseMove, Label1.MouseMove, GroupBox1.MouseMove, PictureBox1.MouseMove
If e.Button = MouseButtons.Left Then
moverForm()
End If
End Sub
End Class