Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Moving Form

  1. #1

    Thread Starter
    Hyperactive Member mrmojorisin's Avatar
    Join Date
    Oct 2007
    Location
    London Town Vocation: Garden Cricket Genuis
    Posts
    439

    Resolved [RESOLVED] [2005] Moving Form

    Afternoon All,

    I have a form with no border(FromBorderStyle = None) and no control box.
    I still want the user to be able to move the form.
    Is the possible?

    Thanks

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005] Moving Form

    Yes, it is possible.
    Code:
    'Declare these 2 variables with class scope
    Private Const WM_NCLBUTTONDOWN As Integer = &HA1S
    Private Const HTCAPTION As Integer = 2
    
    'Then handle your form.MouseDown event
    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
            Me.Capture = False
            Dim msg As Message = Message.Create(Me.Handle, WM_NCLBUTTONDOWN, New IntPtr(HTCAPTION), IntPtr.Zero)
            Me.DefWndProc(msg)
        End Sub

  3. #3

    Thread Starter
    Hyperactive Member mrmojorisin's Avatar
    Join Date
    Oct 2007
    Location
    London Town Vocation: Garden Cricket Genuis
    Posts
    439

    Re: [2005] Moving Form

    Thats really cool...Thanks mate.

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