App.config and Colors

  • Thread starter Thread starter Ralf Hermanns
  • Start date Start date
R

Ralf Hermanns

Hello.

The forms designer allows you to set some properties of a control, like
visible, to dynamic. The actual value is then taken from the app.config
file.

I wonder if there is a way to specify colors this way, for panels or
captions or the form's background.

What I would like to do is extend the forms class with two own properties
for colors, and bind those to the app.config file.
Every control put onto the form should fetch their colors from these
properties of the form they are on.

Does someone have a pointer in MSDN, GotDotNet or similar for an article to
look at, or a code snippet explaining how to add own dynamic properties to a
form?

Thanks in advance,
Ralf
 
* "Ralf Hermanns said:
The forms designer allows you to set some properties of a control, like
visible, to dynamic. The actual value is then taken from the app.config
file.

I wonder if there is a way to specify colors this way, for panels or
captions or the form's background.

What I would like to do is extend the forms class with two own properties
for colors, and bind those to the app.config file.
Every control put onto the form should fetch their colors from these
properties of the form they are on.

Does someone have a pointer in MSDN, GotDotNet or similar for an article to
look at, or a code snippet explaining how to add own dynamic properties to a
form?

You can do that by implementing 'IExtenderProvider', but I am not sure
how this should be linked to the config file. Colors are IMO sort of
"preference" and should not be stored in the config file.
 
Back
Top