Solved

Best way to move control into container

Posted on 2007-04-08
10
266 Views
Last Modified: 2013-11-26
Moving a control into a container control causes it to loose the events it was hooked to.  Sometimes the control is even renamed.  I'd like to take all of the controls I have on a form and put them into a container.  Is there a way to do that without loosing any of the events or properties set on these controls?
0
Comment
Question by:brettr
  • 6
  • 4
10 Comments
 
LVL 5

Expert Comment

by:Yttribium
ID: 18872138
How are you moving them from container to container, also what version of Visual Studio are you using?
0
 

Author Comment

by:brettr
ID: 18872653
Drag and drop.  This should have to the VS.NET 2005 zone.
0
 
LVL 5

Expert Comment

by:Yttribium
ID: 18872657
Strange, I will have to test this, I never had this problem, all my events etc stayed put.
0
 

Author Comment

by:brettr
ID: 18872732
ok, thanks.
0
 
LVL 5

Expert Comment

by:Yttribium
ID: 18872912
If you have a downloadable solution (zipped without the bin files) I might be able to see some "circumstantial" evidence of a problem.  If not, I can create a dummy project, tell me what type of container you're moving it to and from.  (like panel etc)
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 5

Accepted Solution

by:
Yttribium earned 500 total points
ID: 18873483
I just checked, I had no problems like you mentioned, unfortunately (fortunately?)...  Maybe you should describe exactly what you did, I did a lot of shuffling, dragging and dropping all my controls to different tab controls and panels, on a working application (with lots of nice controls and properties set with lots of events) and it worked just the way it did (albeit a bit ugly because of the moving items about into weird places for testing)...
0
 

Author Comment

by:brettr
ID: 18873612
I tried it as well. I got pretty involved with it and everything is fine.  I don't know what to say.  Guess I just wanted to make you work for these points.  I've have it happen before though.  Events for a control get wiped out.  Probably a very unique environment in which it will ever happen.  Thanks.
0
 
LVL 5

Expert Comment

by:Yttribium
ID: 18873625
Glad it's fixed at least :)  Nothing worse than "untraceable" problems...
0
 

Author Comment

by:brettr
ID: 18873697
Actually, this is a more of a problem in ASP.NET.  I took it for granted it would be a winform issue.  Before I got into  moving lots of controls, I wanted to see if anyone knew of a way to avoid loosing properties/events.  So, I should post this in the ASP.NET zone.
0
 
LVL 5

Expert Comment

by:Yttribium
ID: 18873702
Oh that's a different ball of cheese and lint all together, better post there.  If I get time I'll try investigate it, but at the moment I'm busy with a project - post the link here if you can please, I'll peek in hopefully.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is Thread.Sleep? 5 46
Tool Box 2 35
Run time Error 4 35
C# guarantee sql connection close 6 32
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

30 Experts available now in Live!

Get 1:1 Help Now