Results 1 to 3 of 3

Thread: (Resolved) Move Form with no ControlBox in MDI

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    12

    (Resolved) Move Form with no ControlBox in MDI

    Greetings folks..

    I have a FixedToolWindow with no ControlBoxthat I want folks to be able to click inside of the form and drag around the MDI Parent.

    Any easy way to accomplish this?
    Last edited by Wynder; Apr 28th, 2004 at 08:38 AM.

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    Try this...
    VB Code:
    1. Dim MyOffSet As Point
    2.  
    3.     Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
    4.         If e.Button = MouseButtons.Left Then
    5.             MyOffSet = New Point(Cursor.Position.X - Me.Location.X, Cursor.Position.Y - Me.Location.Y)
    6.         End If
    7.  
    8.     End Sub
    9.  
    10.     Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
    11.         If e.Button = MouseButtons.Left Then
    12.             Me.Location = New Point(Cursor.Position.X - MyOffSet.X, Cursor.Position.Y - MyOffSet.Y)
    13.         End If
    14.     End Sub
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    12
    Pax,

    Friggen beautiful.

    Danke,
    Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width