Best way to move control into container

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?
brettrAsked:
Who is Participating?
 
YttribiumConnect With a Mentor Commented:
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
 
YttribiumCommented:
How are you moving them from container to container, also what version of Visual Studio are you using?
0
 
brettrAuthor Commented:
Drag and drop.  This should have to the VS.NET 2005 zone.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
YttribiumCommented:
Strange, I will have to test this, I never had this problem, all my events etc stayed put.
0
 
brettrAuthor Commented:
ok, thanks.
0
 
YttribiumCommented:
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
 
brettrAuthor Commented:
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
 
YttribiumCommented:
Glad it's fixed at least :)  Nothing worse than "untraceable" problems...
0
 
brettrAuthor Commented:
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
 
YttribiumCommented:
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
All Courses

From novice to tech pro — start learning today.