all groups > vb.net data > february 2004 >
You're in the

vb.net data

group:

windows styles


windows styles Kenneth
2/24/2004 4:27:30 PM
vb.net data: Is there a simple way to set border style on all forms, textboxes and
listviews in every form I have, at the load event
Even backcolor


/Kenneth

Re: windows styles Richard T. Edwards NO[at]SPAM pwpsquared.net
2/25/2004 8:05:04 AM
I wouldn't advise doing this in the form load event.

Beyond this, you can enumerate trhough your controls and set the property as
you go.

[quoted text, click to view]

Re: windows styles Tony Martini
3/24/2004 7:05:25 PM
Kenneth
I am new to the news group so I do not know if only certain people are
supposed to post a response or not - but I had an idea that might help.

I think you can use the Inherits statement to accomplish some of what .
Create a form that has the setting that you want.
Then build the solution. ( you have to build a assembly in order to inherit
from a form)
When you create a new form you can use the Inheritance picker to inherit the
settings of this base form you created.
for existing form you can change the statement that that is the first line
of code in your form class that reads Inherits System.Windows.Forms.Form to
Inherits <yournamespace>.<baseform>
This will cause the form to inherit all of the settings of the base form so
you can have a consistent borderstyle and what not. If you modify the
baseform later the forms that inherit it's settings will automatically
inherit the changes ( including controls on the base form which may not be
what you want).
That should help with the form settings. I am not sure it will help with the
borderstyle of individual controls. For individual controls you could try
creating your own listview class that inherits the base listview class and
setting the properties you want to be consistent in the constructor.

I hope this was helpful.

Tony


[quoted text, click to view]

AddThis Social Bookmark Button