Solved

Best way to move control into container

Posted on 2007-04-08
10
265 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
Comment Utility
How are you moving them from container to container, also what version of Visual Studio are you using?
0
 

Author Comment

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

Expert Comment

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

Author Comment

by:brettr
Comment Utility
ok, thanks.
0
 
LVL 5

Expert Comment

by:Yttribium
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 5

Accepted Solution

by:
Yttribium earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Glad it's fixed at least :)  Nothing worse than "untraceable" problems...
0
 

Author Comment

by:brettr
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

10 Experts available now in Live!

Get 1:1 Help Now