Results 1 to 4 of 4

Thread: Drag picBox like a scrollbar..?

  1. #1

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Question Drag picBox like a scrollbar..?

    Hello

    I cant figure out how to simulate a scroll effect instead of using a scrollbar, but being able to drag the picture box up and down..!?!

    I have a picture box within a picture box...!!

    How can i achieve this..?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  2. #2

  3. #3

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Drag picBox like a scrollbar..?

    Thank you but this is not what i need... I already hve this and this is how i Currently scroll up n down, but i want to replace it with a drag method...
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



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

    Re: Drag picBox like a scrollbar..?

    Try this:
    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 Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    10.     If Button = vbLeftButton Then
    11.         ReleaseCapture
    12.         SendMessageLong Picture2.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
    13.     End If
    14. End Sub
    (From here)
    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