Design Time execution of additional code within a form

  • Thread starter Thread starter Gregory Persson
  • Start date Start date
G

Gregory Persson

My question is: How do I cause my custom code to affect the design-time
behavior of the application?

I'm trying to standardize the colors used on all new forms I will create,
without having to set the properties by hand every time.

I have a 2 forms, BaseForm and SubForm, with SubForm inheriting from
BaseForm.
In BaseForm.Load event, I loop through the controls and set their colors.
When I run SubForm, all of the controls show up with the proper colors,
which is great, but I'd like the form to look the same in both run-time AND
design-time.

Any suggestions? Links for further reading?

Thanks,
~Greg
 
Thanks for the reply.

What I was really trying to accomplish was having the designer display
changes from a SetColors() function called in my form Load event handler.

Doing this:

this.SuspendLayout();
this.SetColors();
this.ResumeLayout();

partially works to set the colors of my form at design time without actually
setting the colors in the designer. However, it is far from perfect. I
just gave up on it and decided to move on.

~Greg
 
Back
Top