How to move a control contained within a usercontrol at design time

P

p_cranfield

Hi

I am trying to work out how to move controls contained within a user
controls at design time using the mouse in the IDE.

Consider the following:
Project A contains usercontrol1 with several panels.
Project B contains a form with usercontrol1

I would like to be able to click on a panel in the instance of
usercontrol1 on the form in Project B and simply drag it around the
space of the control.
I have set the "Modifiers" property of the panel to "Public" and can
see it when I look at the property pages of the usercontrol1 instance
on the form. I can even set the location of it. Why can I not simply
drag the panel within the control ? Is it possible ?

Phil
 
G

Guest

The best way is to create a cursor from the panel's graphic's object by
saving it to a bitmap then creating a cursor from the bitmap. This is done
in the mousedown/mousemove event then reposition the panel when the mouseup
event occurs. It's bit trickey and you have to use BitBlt API to do it
quickly and then figure out where the mouse is when you trigger the mouse up
event.
 
P

p_cranfield

That does seem like a lot of work. I think I will just hard code the
layout as and when I need it.
Thanks for your prompt reply Dennis.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top