473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1535
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chien Lau | last post by:
I frequently define internal UserControl-derived classes in my WinForms apps: internal class MyUserControl:UserControl{ ... } I'll often need to embed these controls in a Form, whose class...
9
by: TCORDON | last post by:
I have a user control that contains 2 image buttons, when you click one of them, both must change the image source, the thing is that the first time you click any one of them the page appears to do...
0
by: Chad | last post by:
I know that in order to receive events from dynamically added controls, you need to recreate the control with each postback, and then re-attach the event handler. This is thge first time I am...
0
by: s.gregory | last post by:
My page layout is like this: Page >DataList (databound using ObjectDataSource1 contained in page) >>Items >>>UserControl >>>>GridView (databound using another ObjectDataSource2 contained in...
7
by: crowl | last post by:
VS.2003, .NET Framework 1.1, C# My goal: Creating a dll (helper.dll) which contains some UserControls and some other helpful classes in order to use it in other projects. Symtoms: The...
2
by: Joe | last post by:
Hello all, When I drop a control (say a Button) on my user control, the button is added to the parent control of my user control and not my control. For example if my user control is on a panel...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
11
by: Newbie Coder | last post by:
Hi All VB.NET 2003 Can anyone tell me how to stop a user control being able to be resized during both design time & run time, please? I am looking for something like the LOCKED property,...
3
by: Cyr1dian | last post by:
Hi, My problem is that a custom control "newA" that inherits from a base custom control "baseA" is not displaying any contained controls - that were not inherited - at run time, but displays...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.