Click here to Skip to main content
15,917,176 members
Home / Discussions / C#
   

C#

 
GeneralRe: integer type in C# Pin
George_George15-Apr-08 2:56
George_George15-Apr-08 2:56 
GeneralRe: integer type in C# Pin
Gareth H15-Apr-08 0:34
Gareth H15-Apr-08 0:34 
GeneralRe: integer type in C# Pin
George_George15-Apr-08 2:56
George_George15-Apr-08 2:56 
GeneralRe: integer type in C# Pin
leppie15-Apr-08 4:28
leppie15-Apr-08 4:28 
GeneralRe: integer type in C# Pin
George_George15-Apr-08 4:30
George_George15-Apr-08 4:30 
QuestionHow to move all items(not selected) in a listbox to a string array?? Pin
syamooo14-Apr-08 23:23
syamooo14-Apr-08 23:23 
GeneralRe: How to move all items(not selected) in a listbox to a string array?? Pin
phannon8614-Apr-08 23:49
professionalphannon8614-Apr-08 23:49 
QuestionHow to create global variable Pin
cocoonwls14-Apr-08 23:17
cocoonwls14-Apr-08 23:17 
Hi all,

In my application i have 5 forms. I would like to store some value in global varialble which can access by any forms in my app.I have try to create a get/set class and i declare a public object in form let said form A. But i can't access the object in form B. My example coding as below:

Class GetSet:

private String _name;<br />
public String name<br />
{<br />
  get{return _name;}<br />
  set{_name = value;}<br />
}


FormA:

public partial class FrmA : Form<br />
{<br />
   GetSet gs;<br />
   public FrmMain()<br />
   {<br />
     gs = new GetSet();<br />
     gs.name = "cocoon";<br />
   }<br />
<br />
}


FormB:
public partial class FrmB : Form<br />
{<br />
   GetSet gs;<br />
   public FrmMain()<br />
   {<br />
      console.write(gs.name);<br />
   }<br />
<br />
}



Can anyone guide me to slove this out.
thanks in advance

regards
cocoon
AnswerRe: How to create global variable Pin
Vikram A Punathambekar14-Apr-08 23:56
Vikram A Punathambekar14-Apr-08 23:56 
AnswerRe: How to create global variable Pin
Christian Graus14-Apr-08 23:57
protectorChristian Graus14-Apr-08 23:57 
AnswerRe: How to create global variable Pin
cocoonwls15-Apr-08 18:43
cocoonwls15-Apr-08 18:43 
AnswerRe: How to create global variable Pin
sarvesh.upadhyay16-Apr-08 2:15
professionalsarvesh.upadhyay16-Apr-08 2:15 
QuestionAdvise nedded Pin
bdiepeveen14-Apr-08 23:08
bdiepeveen14-Apr-08 23:08 
GeneralRe: Advise nedded Pin
phannon8614-Apr-08 23:25
professionalphannon8614-Apr-08 23:25 
GeneralRe: Advise nedded Pin
bdiepeveen14-Apr-08 23:50
bdiepeveen14-Apr-08 23:50 
GeneralRe: Advise nedded Pin
phannon8614-Apr-08 23:57
professionalphannon8614-Apr-08 23:57 
GeneralRe: Advise nedded Pin
Vasudevan Deepak Kumar15-Apr-08 0:29
Vasudevan Deepak Kumar15-Apr-08 0:29 
GeneralRe: Advise nedded Pin
N a v a n e e t h15-Apr-08 0:40
N a v a n e e t h15-Apr-08 0:40 
GeneralRe: Advise nedded Pin
bdiepeveen15-Apr-08 22:58
bdiepeveen15-Apr-08 22:58 
GeneralRe: Advise nedded Pin
bdiepeveen15-Apr-08 2:07
bdiepeveen15-Apr-08 2:07 
QuestionAccess + Stored procedure = bad ideea? Pin
Razvan Dimescu14-Apr-08 22:22
Razvan Dimescu14-Apr-08 22:22 
AnswerRe: Access + Stored procedure = bad ideea? Pin
Dave Kreskowiak15-Apr-08 4:56
mveDave Kreskowiak15-Apr-08 4:56 
GeneralAbt datetime manupulation Pin
tasumisra14-Apr-08 21:25
tasumisra14-Apr-08 21:25 
GeneralRe: Abt datetime manupulation Pin
Vikram A Punathambekar14-Apr-08 21:32
Vikram A Punathambekar14-Apr-08 21:32 
GeneralRe: Abt datetime manupulation Pin
tasumisra14-Apr-08 21:39
tasumisra14-Apr-08 21:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.