New Move Borderless form Code
Use this board to post your code snippets - tips and tricks
5 posts
Page 1 of 1
Hi all
Ok i know we have 2 or 3 examples on here for moving borderless forms, well here is another example that you all can you use in your apps if you wish.
Put this after your Public Class Form1 ( or whatever your Form is called )
enjoy cooll;
Chris
Ok i know we have 2 or 3 examples on here for moving borderless forms, well here is another example that you all can you use in your apps if you wish.
Put this after your Public Class Form1 ( or whatever your Form is called )
Code: Select all
Form Mouse Down Code
Private mouseOffset As Point
Code: Select all
Form Mouse Move Code
mouseOffset = New Point(-e.X, -e.Y)
Code: Select all
and that's itIf e.Button = Windows.Forms.MouseButtons.Left Then
Dim mousePos As Point = Control.MousePosition
mousePos.Offset(mouseOffset.X, mouseOffset.Y)
Location = mousePos
End If
enjoy cooll;
Chris
Well i thought when i saw the title. Whats the point?! And this is the shortest code ive seen ill need to change all of mine now ;) Thanks HH.
Lewis.
Lewis.
thanks i changed the form1 code to pictureboxes for my xfire utility


Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

This code runs alot smoother than using a timer
, thanks hungry 


There is another simple way:
Code: Select all
Form1_MouseMove:
Private point As New Point
Code: Select all
And there you go, an ultra smooth and functional way to move a borderless form.Dim it As New Size(e.X - point.X, e.Y - point.Y)
If (e.Button = MouseButtons.Left) Then
Me.Location += it
point = e.Location - it
Else
point = e.Location
End If
End Sub
5 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023