LicenseManager.UsageMode
is intended for this.
It is in fact the only reliable way to detect if your control is in design mode or not. It's only valid during the constructor, but it can easily be stored in a field of the class for later reference.
The DesignMode
property for nested controls will be false even when the container control is in design mode.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…