You mean move the controls around on the form after runtime?
How do I make the tool draggable?Like a normal tool window?
Virus Scans:
VirusTotal Scan
Jotti's Malware Scan
MetaScan Scan Results
You mean move the controls around on the form after runtime?
You have to provide a image of it in order for it to be approved.
From what I see, you want to know how to move the form when you uses like none on the formstyle.
Something I found on the net:
Code:Public Class Form1 'Declare the variables Dim drag As Boolean Dim mousex As Integer Dim mousey As Integer Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown drag = True 'Sets the variable drag to true. mousex = Windows.Forms.Cursor.Position.X - Me.Left 'Sets variable mousex mousey = Windows.Forms.Cursor.Position.Y - Me.Top 'Sets variable mousey End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove 'If drag is set to true then move the form accordingly. If drag Then Me.Top = Windows.Forms.Cursor.Position.Y - mousey Me.Left = Windows.Forms.Cursor.Position.X - mousex End If End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp drag = False 'Sets drag to false, so the form does not move according to the code in MouseMove End Sub End Class
calvin839 (06-16-2012)
@Jorndel
A far cleaner and better solution would be to use the form mouse down event and WndProc.
Thats all the code needed to move a borderless form.Code:Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown Capture = False WndProc(Message.Create(Handle, &HA1, New IntPtr(2), IntPtr.Zero)) End Sub
The other method works just fine aswell but alot more messing about.
I'v used both methods in the past, depends on my situation.
calvin839 (06-16-2012)
Yes both codes will let you drag it. And if you wish to resize the form aswell, this will do it
Dragging the bottom right corner of the form allows you to resize.Code:Protected Overrides Sub WndProc(ByRef Msg As Message) If (Msg.Msg = &H84) Then Dim _Point As Point = PointToClient(New Point(CInt(Msg.LParam.ToInt64 + &HFFFF), CInt((Msg.LParam.ToInt64 + &HFFFF0000) >> &H10))) Dim _Size As Size = ClientSize If (_Point.X >= _Size.Width - &H10 AndAlso _Point.Y >= _Size.Height - &H10 AndAlso _Size.Height >= &H10) Then Msg.Result = If(IsMirrored, New IntPtr(&H10), New IntPtr(&H11)) Return End If End If MyBase.WndProc(Msg) End Sub
calvin839 (06-16-2012)
calvin839 (06-16-2012)
Hey dumbfucks, draw on a Form control. Set the FormBorderStyle to "None". Winner winner chicken dinner.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
Try this code:
This lets you Maximize the window as well.
Code:#Region "Move Form" Const WM_NCHITTEST As Integer = &H84 Const HTCLIENT As Integer = &H1 Const HTCAPTION As Integer = &H2 Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Select Case m.Msg Case WM_NCHITTEST MyBase.WndProc(m) If m.Result = HTCLIENT Then m.Result = HTCAPTION Case Else MyBase.WndProc(m) End Select End Sub #End Region
I think that worksCode:Public Class Form1 Private MausLocation As Point Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then MausLocation = e.Location End If End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If e.Button = Windows.Forms.MouseButtons.Left Then Me.Location = e.Location - MausLocation + Me.Location End If End Sub End Class![]()