473,385 Members | 1,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sharing variables across Forms

Hi,
I have a set of Forms and wish to have a varible used by more than one
of them but can't seem to figure where to initialise it or how to
acess it if I initialise it in a different form than the one that is
accessing it!

Any help appreciated!
Denis
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
2 1648
Create a class and declare public static variable.
You can use these variable across the project.

Regards,
Amal

"Denis_dh" wrote:
Hi,
I have a set of Forms and wish to have a varible used by more than one
of them but can't seem to figure where to initialise it or how to
acess it if I initialise it in a different form than the one that is
accessing it!

Any help appreciated!
Denis
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 16 '05 #2
Dennis,

I don't like this, however when you want it can you make your own class with
static variables.
Know that than every class that uses those is directly depended from that
class.

MessageBox.Show(Myname.I);
\\\
public class Myname
{
static public string I = "Cor";
}
///

I don't like it.

Cor
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in...
3
by: Mothish K | last post by:
Hello, I am trying to connect 2 of my asp.net applications using context.items collections to share the variables. but it says Could not load type 'Proj2.SignIn'. I have set the...
1
by: Terry Olsen | last post by:
What is the best practice for sharing variables across modules in the same project? I'm doing a console app with different modules for different functions (file i/o, sql commands, string...
6
by: awhan.iitk | last post by:
I have a set of variables that I want to share across mulitple c++ files. I was using the extern method so far. Is there any other way to do the same. The variables are not constants and I get the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.