Some events are fired in the designer as well, it is what gives the Winforms designer its wysiwyg ability. Notably Paint, Shown is also fired, etcetera. The DesignMode property is provided to allow you to tell whether your event handler is running at design-time. Fix:
void BaseClass_Shown(object sender, EventArgs e) {
if (!this.DesignMode) {
Close();
MessageBox.Show("This cannot be opened.");
}
}
Do note the flaw in your approach, this event also fires for a derived form. You might be helping too much.