Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Help Moving Borderless Window

QuestionHelp Moving Borderless Window

Posts 1–11 of 11 · Page 1 of 1
calvin839
calvin839
Help Moving Borderless Window


How do I make the tool draggable?Like a normal tool window?



Virus Scans:
VirusTotal Scan

Jotti's Malware Scan

MetaScan Scan Results

#1 · edited 14y ago · 14y ago
Pingo
Pingo
You mean move the controls around on the form after runtime?
#2 · 14y ago
Jorndel
Jorndel
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
#3 · 14y ago
Pingo
Pingo
@Jorndel
A far cleaner and better solution would be to use the form mouse down event and WndProc.
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
Thats all the code needed to move a borderless form.
The other method works just fine aswell but alot more messing about.
I'v used both methods in the past, depends on my situation.
#4 · 14y ago
calvin839
calvin839
Thanks for the replies.

But would the code you've mentioned help me drag the window since I used none as a form design.
#5 · 14y ago
Pingo
Pingo
Yes both codes will let you drag it. And if you wish to resize the form aswell, this will do it
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
Dragging the bottom right corner of the form allows you to resize.
#6 · 14y ago
calvin839
calvin839
Thanks Pingo!It works nicely.

---------- Post added at 09:07 PM ---------- Previous post was at 08:58 PM ----------

Btw,do you guys happen to know how to map a function to a certain keyboard key?Like mapping "ENTER" with the equal sign for the above. o-o[COLOR="Silver"]
#7 · 14y ago
Jorndel
Jorndel
Quote Originally Posted by calvin839 View Post
Thanks Pingo!It works nicely.

---------- Post added at 09:07 PM ---------- Previous post was at 08:58 PM ----------

Btw,do you guys happen to know how to map a function to a certain keyboard key?Like mapping "ENTER" with the equal sign for the above. o-o[COLOR="Silver"]
Try to add an keydown event for the button?
And do a check. e.KeyData = Keys.Enter

And on the form set this to True: Key Preview
#8 · 14y ago
Jason
Jason
Hey dumbfucks, draw on a Form control. Set the FormBorderStyle to "None". Winner winner chicken dinner.
#9 · 14y ago
DA
DawgiiStylz
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
#10 · 14y ago
.:.Apple?!.:.
.:.Apple?!.:.
Code:
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
I think that works
#11 · 14y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

  • Help with Teamspeak windowed modeBy CyborgDeamon in Combat Arms Hacks & Cheats
    5Last post 17y ago
  • [Help] Combat arms WindowBy shawnyboi15 in Combat Arms Help
    7Last post 16y ago
  • Help, Check If windows is shutting down!By Zoom in Visual Basic Programming
    6Last post 16y ago
  • [Help]About.vb Windows FormBy LetItRock in Visual Basic Programming
    12Last post 16y ago
  • [Help]Moving things around`By Samueldo in Visual Basic Programming
    7Last post 16y ago

Tags for this Thread

#help#newbie#programming#studio#visual