Solved

Best way to move control into container

Posted on 2007-04-08
10
267 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
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.

 

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
 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

810 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