Results 1 to 6 of 6

Thread: Move a panel

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    South Charleston, WV, USA
    Posts
    607

    Move a panel

    I have a panel on an MDI form which is scrollable by the user with scroll bars. I would like to know if there is any way this could be modified so that the user could drag the panel with the cursor? If so, can you supply the correct event and code?

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Move a panel

    Check out my signature, there's a link to a codebank thread that shows you how you can let the user move (and even resize if you want to) controls. I've neatly packed the code into a class so all you need to do yourself (besides adding the class to your project) is this:
    Code:
    Dim movePanel As New MoveControl(Panel1)
    And that's it. Panel1 will then be resizable and movable by the user. You can disable resizing (altogether or just in some directions) or moving if you want, read the thread for details.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    South Charleston, WV, USA
    Posts
    607

    Re: Move a panel

    I have a panel on a borderless form which is a child of an MDI form that does have a border. Will this work? I only need to move the panel, not resize it. But the controls have to move with it. Also there currently are vertical and horizontal scroll bars. If I move the panel, will the scroll bars move to the proper position? Or do I have to get rid of the scroll bars completely?

  4. #4
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Move a panel

    Yes is the simple answer. Why didn't you try it out?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    South Charleston, WV, USA
    Posts
    607

    Re: Move a panel

    Because I have another project I'm working on simultaneously and I'm short of time and I'd hate to spend time on something that's not going to work.

  6. #6
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Move a panel

    I think you would have spent 10 times less time just trying it out then posting 'will it work' on this forum, let alone wait for answers.

    You are talking about your form having a border, so I think you are confused over my link. There are two posts in that thread, one is about moving a borderless form (not relevant here) and the second is about moving a control.

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