Hello:
In all my forms I have around 30+ variables that are public for the form.
How can I have the 30+ in one place so I dont have to check is any of then are missing in any of the forms?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaish MathewsRank #225 · 11K reputationPosted May 16, 2010, 1:08 AM EDT
It's not clear as once any variable missed, it's reference will throw compile error. So no separate checking needed as compiler already checking for you.
Kirtan PatelRank #292 · 8.6K reputationPosted May 16, 2010, 1:26 AM EDT
so you can access any of the variable from class file from any form ..
GustavoRank #1,990 · 732 reputationPosted May 16, 2010, 4:46 AM EDT
I tried the Class, but then they are common, the values are the same.
The 30+ variable values, I need them to be unique to each Form.
Would like something like the c/c+ #include "Vars"
Example:
public string RunAs;
I have a variable called RunAs, I set it in each for to whatever I want it to run as. So, when I go from Form to Form, I want to keep the value that is was set for that Form.
Kirtan PatelRank #292 · 8.6K reputationPosted May 16, 2010, 8:28 AM EDT
just redefine the methods you want to by using overriding the methods in base form ..
GustavoRank #1,990 · 732 reputationPosted May 16, 2010, 10:12 AM EDT
I did create a "Generic" Form (FormGeneric). Then I created a form with the inhearit, but it does not copy the variables in it.
I will pay with it and try to figure it out. Will get back to you, if I can not get it to work for me.