Change Public variables before initializing a form
I am looking for a convenient way to use Global/Public variables in a windows form. I would like to have several Form level variables to be set up before the window form is initialized so that the form could be initialized and formated based on the values of these variable.
How to do this in C# with a mind of OOP?
Re: Change Public variables before initializing a form
Place your code in the constructor before the "InitializeComponent();"
Re: Change Public variables before initializing a form
Thx for reply. The code should be in calling form/object to change variables and initialize the form.
My question is what is the common way to do it? Do I have to create a new form constructor with these variables as parameters or some kind of public class stuff?
Re: Change Public variables before initializing a form
a new constructor is the most common way to do this