Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. moving a Form With No Border

moving a Form With No Border

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    Orlando_Herrera
    wrote on last edited by
    #1

    sorry foy my english again. I want clic on my WinForm and move it (rigth, left, up, down) how can i do it? i am from mexico....thanks CodeProject :)

    C K T 3 Replies Last reply
    0
    • O Orlando_Herrera

      sorry foy my english again. I want clic on my WinForm and move it (rigth, left, up, down) how can i do it? i am from mexico....thanks CodeProject :)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You need to write the code to do this, handle a mouse down, mouse move and mouse up on your form. While the mouse is down, if the mouse moves, move the form.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • O Orlando_Herrera

        sorry foy my english again. I want clic on my WinForm and move it (rigth, left, up, down) how can i do it? i am from mexico....thanks CodeProject :)

        K Offline
        K Offline
        Kristian Sixhoj
        wrote on last edited by
        #3

        http://www.codeproject.com/KB/vbscript/VBBorderless.aspx[^]

        Kristian Sixhoej


        "Failure is not an option" - Gene Kranz

        1 Reply Last reply
        0
        • O Orlando_Herrera

          sorry foy my english again. I want clic on my WinForm and move it (rigth, left, up, down) how can i do it? i am from mexico....thanks CodeProject :)

          T Offline
          T Offline
          The ANZAC
          wrote on last edited by
          #4

          This Works like a dream for me. Dim pt as point dim hdMousDown as Boolean Private Sub SetPoint() If hdMousedown = True Then hdMousedown = False Else hdMousedown = True pt = Me.PointToClient(Control.MousePosition) End Sub Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseDown SetPoint() End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseUp SetPoint() End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseMove If hdMousedown = True Then Me.Location = New Point(Control.MousePosition.X - pt.X, Control.MousePosition.Y - pt.Y) End If End Sub

          Please check out my articles: The ANZAC's articles

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups