Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
QuestionAccess a variable Pin
Dothanhnam13-Mar-07 23:05
Dothanhnam13-Mar-07 23:05 
AnswerRe: Access a variable Pin
Keshav V. Kamat13-Mar-07 23:11
Keshav V. Kamat13-Mar-07 23:11 
AnswerRe: Access a variable Pin
darkcalin13-Mar-07 23:13
darkcalin13-Mar-07 23:13 
GeneralRe: Access a variable Pin
Keshav V. Kamat13-Mar-07 23:20
Keshav V. Kamat13-Mar-07 23:20 
GeneralRe: Access a variable Pin
Colin Angus Mackay14-Mar-07 0:39
Colin Angus Mackay14-Mar-07 0:39 
AnswerRe: Access a variable Pin
N a v a n e e t h13-Mar-07 23:18
N a v a n e e t h13-Mar-07 23:18 
GeneralRe: Access a variable Pin
Dothanhnam13-Mar-07 23:25
Dothanhnam13-Mar-07 23:25 
AnswerRe: Access a variable Pin
Keshav V. Kamat13-Mar-07 23:25
Keshav V. Kamat13-Mar-07 23:25 
namespace Sample
{
public partial class Form1 : Form
{
}

// create a separate class here
public class mySeparateClass
{
public static int globalVariable=new int();
}
}


Once you have done that, u can access the variable globalVariable, anywhere in all the forms of the project using the classname as follows.

mySeparateClass.globalVariable


try it.;)





Keshav Kamat Smile | :)
India

GeneralRe: Access a variable Pin
Colin Angus Mackay14-Mar-07 0:43
Colin Angus Mackay14-Mar-07 0:43 
AnswerRe: Access a variable Pin
Colin Angus Mackay14-Mar-07 0:41
Colin Angus Mackay14-Mar-07 0:41 
QuestionHelp me! Pin
Dothanhnam13-Mar-07 22:42
Dothanhnam13-Mar-07 22:42 
AnswerRe: Help me! Pin
Keshav V. Kamat13-Mar-07 22:48
Keshav V. Kamat13-Mar-07 22:48 
GeneralRe: Help me! Pin
netJP12L14-Mar-07 5:53
netJP12L14-Mar-07 5:53 
QuestionPlease Very urgent - WEBDAV method - REgarding Pin
ArunkumarSundaravelu13-Mar-07 22:18
ArunkumarSundaravelu13-Mar-07 22:18 
Questionxml from dataTable *hwo can sole this??[modified] Pin
darkcalin13-Mar-07 22:10
darkcalin13-Mar-07 22:10 
AnswerRe: xml from dataTable *hwo can sole this??[modified] Pin
N a v a n e e t h13-Mar-07 23:24
N a v a n e e t h13-Mar-07 23:24 
GeneralRe: xml from dataTable *hwo can sole this??[modified] Pin
darkcalin13-Mar-07 23:27
darkcalin13-Mar-07 23:27 
QuestionClose Form Pin
Dothanhnam13-Mar-07 21:53
Dothanhnam13-Mar-07 21:53 
AnswerRe: Close Form Pin
Dmitry Khudorozhkov13-Mar-07 22:12
Dmitry Khudorozhkov13-Mar-07 22:12 
AnswerRe: Close Form Pin
darkcalin13-Mar-07 22:25
darkcalin13-Mar-07 22:25 
GeneralRe: Close Form Pin
Keshav V. Kamat13-Mar-07 22:44
Keshav V. Kamat13-Mar-07 22:44 
GeneralRe: Close Form Pin
darkcalin13-Mar-07 22:47
darkcalin13-Mar-07 22:47 
JokeRe: Close Form Pin
N a v a n e e t h13-Mar-07 23:20
N a v a n e e t h13-Mar-07 23:20 
Questionmax size of sql database Pin
Keshav V. Kamat13-Mar-07 21:27
Keshav V. Kamat13-Mar-07 21:27 
AnswerRe: max size of sql database Pin
Colin Angus Mackay13-Mar-07 22:58
Colin Angus Mackay13-Mar-07 22:58 

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.