Click to See Complete Forum and Search --> : Stylesheet for windows forms??


Satishpp
June 11th, 2003, 03:10 PM
Hi,

Is there any way to have some sort of stylesheet for a windows form, the same way one could have it for a web form.

The stylesheet should allow me to change the font / color etc of forms and controls, without having to go into the code and change the properties for each control / form.

Thanks
Satish

pareshgh
June 11th, 2003, 03:36 PM
you can obtain such type of effect by using and assigning and reading values from Properties .

i am not sure how to use it but some days ago i saw some sample.
i don't recall where i saw
:(

Satishpp
June 11th, 2003, 04:05 PM
I was thinking of something like that, but I am running into problems.

This is what I have done currently...

1) I have a xml file which gives me property names and values

2) On application start I read the xml and load these propery names and thier values into a hashtable

3) The application code should be written such that fonts / colors etc should be read from the hash.

The problem is that while I could set the color of a form / control from a variable, using Color.FromName(variable)

I cant do the same in many cases for example say borderstyle of a form....


Any ideas, how to go around this

Satish

pareshgh
June 11th, 2003, 04:26 PM
i think that has to do something with XML design.
that approach won't help much.

actually you can take help of Property Pages and store the Properties.
have you tried some samples ! search CodeProject with property
as search word

Paresh