In fact, it is a very simple thing at the beginning, but I still spend more than 3 hours to solve.
After using several userControl in the project, the first control is still working very well, but starting to add some code in UserControl, the control in the designer form, suddenly can't be selected, and cannot view attributes stand up. However, the functionality of these controls is normal at the time of running. This makes me very confused, and later discovered that Visual Studio 2003 IDE prompts when the design status is prompted: The object reference is not set to an object instance.
After a long time, I understand that this sentence is actually NullReference anomalies, in fact, it is still probably this exception is easier to understand.
In the MSDN, there is no detailed description, the Ide designer work, in fact, IDE is displaying userControl, some event methods are triggered, there are several events, which trigger it is not very clear, but there are two events There must be triggered, LOAD and LAYOUT, and the problematic control has renovated these events and has some database operations that reference other libraries, which are not available at design time.
The solution is also very simple, isolating the code that is not available in the design time in LOAD and LAYOUT event processing, with:
IF (! this.designmode)
{
// Event processing at runtime. . .
}