How to create a derived ComboBox with pre-bound datasource that is designer friendly?

The problem is that the designer actually does some compilation and execution in a slightly different context than normally running the program does.

The problem is that the designer actually does some compilation and execution in a slightly different context than normally running the program does. In the constructor, you can wrap your code in: if (!DesignMode) { //Do this stuff } That will tell the designer to not run any of your initialization code while it is being designed.

DesignMode property doesn't work in a constructor. From googling for a while, found this LicenseManager thing. If (LicenseManager.

UsageMode! = LicenseUsageMode. Designtime) { // Do your database/IO/remote call } However LicenseManager only works in constructors.

For eventhandlers use DesignMode. Source: dotnetfacts.blogspot.com/2009/01/identif... Another reference: weblogs.asp.net/fmarguerie/archive/2005/....

That's kind of weird, but I did learn something. So, I call it a win. – toast Jan 26 '09 at 14:51.

My usual comment here - DesignMode is not reliable in any situation other than if the control is placed directly on a design surface - i.e. If the control is placed on another control, DesignMode is not true even if you are in design mode. I have found NO reliable way to tell if you are in design mode - especially with inherited controls.

Even variants using Site are not reliable if the control is inherited from a non-visual control (e.g. Common Dialog). See keyofdflat.livejournal.com/5407.html (make sure to read the last comment).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions