I have a project that has forms that inherit properties from a base form (called frmBase). I have run into an issue that is really confusing me:
I want the program to center on the user screen, so I added
this.CenterToScreen();
to frmBase_Load(). That works great when I run the app, BUT, when I try to design any of the forms that inherit from frmBase, they all get moved to the very bottom right corner of the designer screen and I have to use scrollbars to see them.
If I move the
this.CenterToScreen();
to the frmBase() code, the app defaults to the top-left of the screen when it runs, but the designer displays the form correctly for me. Any idea what is going on? I searched, but can't seem to find a similar question, although I know I can't be the first person this has happened to. . . . .
if (!DesignMode)
to prevent such code from getting in the way. – Cornstalkif (!DesignMode)
to load event handler of your base form. – NataliaDesignMode
doesnt always work. Look here – Hauler