Yes sure, Ok here is the long story,
Once something really crazy happened to our project, I had a form in my solution and when I was clicking on it, in solution explorer tab, visual studio.net was shutting itself off. That was one of the weirdest things in my programming life.
I tried to find what the problem is, and I succeeded, I had some user controls in my form, those user controls were using the database class that I have made for my application, When you use a user control in your form, and when you are in design mode, dot net is actually compiling and executing your user control.
For example if you put a Msgbox("foo") in the Load event of your user control, and then you use that usercontrol in a form and try to see the design view of your form in vs.net, you are going to see a foo message event hough you haven't even built your application yet. You see what I mean?
I remember in ASP.NET I had encountered a similar problem, I had a usercontrol that was showing a calendar, now when that calendar was being shown to the user on a webpage, it must show a calendar, but when you are in vs.net and you are designing the form in which you want the calendar to show up, you don't want to see that calendar, but a simple textbox instead. There was a way of doing this by some xml tags in ASP.NET, I wonder if there is an equivalent for that in windows based applications.
In summary a control in .net has two interfaces, one is for design mode, and one is for run time mode, now how can we know in code that the control is being watched under the design mode or run time mode? Whom is this control being shown to? the user who has executed the application or the programmer who is using our user control in a developing IDE such as vs.net.
I hope that's more clear now.
Thanks