|
-
Jun 6th, 2006, 02:19 PM
#1
Thread Starter
Addicted Member
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?
Last edited by Winla; Jun 6th, 2006 at 02:57 PM.
-
Jun 6th, 2006, 02:29 PM
#2
Re: Change Public variables before initializing a form
Place your code in the constructor before the "InitializeComponent();"
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 6th, 2006, 02:40 PM
#3
Thread Starter
Addicted Member
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?
-
Jun 6th, 2006, 02:45 PM
#4
Re: Change Public variables before initializing a form
a new constructor is the most common way to do this
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|