PC Review


Reply
Thread Tools Rate Thread

Design Time execution of additional code within a form

 
 
Gregory Persson
Guest
Posts: n/a
 
      8th Aug 2003
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


 
Reply With Quote
 
 
 
 
Gregory Persson
Guest
Posts: n/a
 
      11th Aug 2003
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
"Shriram narayanan" <(E-Mail Removed)> wrote in message
news:011401c35dd8$50302f00$(E-Mail Removed)...
> Greg ,
>
> I suppose, you are talking about Form based Inheritance.
>
> It is possible to provide the Visual Inheritance in .NET .
>
> Create a Parent Form (place 2 command button with back
> colors Blue and Red )
>
> Add a Child Form to that Project (through Add Inherited
> Form , menu item ) and you will see the visual properties
> of the parent form inherited to its Child .
>
> For more information , look MSDN for Visual Inheritance.
>
> Thanks
> Shriram
>
>
>
>
>
>
> >-----Original Message-----
> >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
> >
> >
> >.
> >



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form design view with Fatal Execution Engine Error (7A2B45A2) (0) =?Utf-8?B?TGkgV2VuZw==?= Microsoft Dot NET Framework 2 13th Mar 2007 07:02 AM
Form design view with Fatal Execution Engine Error (7A2B45A2) (0) =?Utf-8?B?TGkgV2VuZw==?= Microsoft Dot NET 1 9th Mar 2007 07:21 AM
code execution on child form @ design time? Scott Microsoft VB .NET 1 22nd Dec 2006 03:00 PM
Prevent code execution in form design view Sagaert Johan Microsoft C# .NET 1 20th Nov 2005 07:33 PM
Form Design in Outlook - adding additional 'pages' Roy Darcy Microsoft Outlook Form Programming 1 21st Oct 2003 05:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:45 PM.