469,951 Members | 2,588 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

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

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

May 12 '06 #1
2 1364
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.
--
Dennis in Houston
"p_*********@yahoo.co.uk" wrote:
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

May 12 '06 #2
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.

May 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Chien Lau | last post: by
9 posts views Thread by TCORDON | last post: by
11 posts views Thread by Newbie Coder | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.