Results 1 to 5 of 5

Thread: [RESOLVED] Move borderless form within another form

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    2

    Resolved [RESOLVED] Move borderless form within another form

    hello

    I was wondering how to move a borderless form but only within the area of another borderless form.

    Thanx
    Last edited by janewilder; Jan 8th, 2006 at 10:42 PM.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Move borderless form within another form

    Welcome to Forums, janewilder!

    Try the following and let me know if it works for you:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Const WM_NCLBUTTONDOWN = &HA1
    4. Private Const HTCAPTION = 2
    5.  
    6. Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    7. Private Declare Function ReleaseCapture Lib "user32" () As Long
    8.  
    9. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    10.     If Button = vbLeftButton Then
    11.         ReleaseCapture
    12.         SendMessageLong Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
    13.     End If
    14. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    2

    Re: Move borderless form within another form

    It worked. Thank you for the help!

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [RESOLVED] Move borderless form within another form

    Dear RhinoBull,
    Can you please place some comment on the coding.
    Please mark you thread resolved using the Thread Tools as shown

  5. #5
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: [RESOLVED] Move borderless form within another form

    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


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