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?
Printable View
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?
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:
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.Code:Dim movePanel As New MoveControl(Panel1)
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?
Yes is the simple answer. Why didn't you try it out?
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.
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.