Click here to Skip to main content
16,005,169 members
Home / Discussions / C#
   

C#

 
AnswerRe: Convert a String to Binary Pin
Vikram A Punathambekar13-Dec-05 21:28
Vikram A Punathambekar13-Dec-05 21:28 
AnswerRe: Convert a String to Binary Pin
MarcelErz13-Dec-05 21:44
MarcelErz13-Dec-05 21:44 
Questionopen a remote excel file Pin
cerdemorenel13-Dec-05 20:07
cerdemorenel13-Dec-05 20:07 
QuestionDefining Global Variable Pin
freshonlineMax13-Dec-05 20:03
freshonlineMax13-Dec-05 20:03 
AnswerRe: Defining Global Variable Pin
-Rowan-13-Dec-05 21:07
-Rowan-13-Dec-05 21:07 
GeneralRe: Defining Global Variable Pin
MarcelErz13-Dec-05 21:27
MarcelErz13-Dec-05 21:27 
GeneralRe: Defining Global Variable Pin
freshonlineMax13-Dec-05 22:45
freshonlineMax13-Dec-05 22:45 
GeneralRe: Defining Global Variable Pin
MarcelErz13-Dec-05 23:06
MarcelErz13-Dec-05 23:06 
Hi!

Sure, no problem! Here is an example:

<br />
Public Class Form1() : System.Windows.Forms.Form<br />
{<br />
 // declare your variable as public static to access it from other classes too<br />
 public static string globalVar = "500";<br />
 ..<br />
}<br />


Later on in the other Form...:

<br />
Public Class Form2() : System.Windows.Forms.Form<br />
{<br />
 private void button1_Click(object sender, System.EventArgs e)<br />
 {<br />
  MessageBox.Show(Form1.globalVar);<br />
 }<br />
}<br />


Marcel Erz
GeneralRe: Defining Global Variable Pin
freshonlineMax14-Dec-05 18:04
freshonlineMax14-Dec-05 18:04 
GeneralRe: Defining Global Variable Pin
ariez78631-Dec-08 21:00
ariez78631-Dec-08 21:00 
AnswerRe: Defining Global Variable Pin
Vikram A Punathambekar13-Dec-05 21:32
Vikram A Punathambekar13-Dec-05 21:32 
QuestionCustom window in C# Pin
CoolASL13-Dec-05 18:35
CoolASL13-Dec-05 18:35 
AnswerRe: Custom window in C# Pin
MarcelErz13-Dec-05 21:34
MarcelErz13-Dec-05 21:34 
GeneralRe: Custom window in C# Pin
CoolASL13-Dec-05 22:15
CoolASL13-Dec-05 22:15 
GeneralRe: Custom window in C# Pin
MarcelErz13-Dec-05 22:32
MarcelErz13-Dec-05 22:32 
GeneralRe: Custom window in C# Pin
CoolASL13-Dec-05 22:35
CoolASL13-Dec-05 22:35 
GeneralRe: Custom window in C# Pin
CoolASL14-Dec-05 2:30
CoolASL14-Dec-05 2:30 
QuestionTextfile and its schema Pin
Mahi.Ragava13-Dec-05 18:19
Mahi.Ragava13-Dec-05 18:19 
AnswerRe: Textfile and its schema Pin
MarcelErz13-Dec-05 22:03
MarcelErz13-Dec-05 22:03 
GeneralRe: Textfile and its schema Pin
Mahi.Ragava13-Dec-05 22:09
Mahi.Ragava13-Dec-05 22:09 
GeneralRe: Textfile and its schema Pin
MarcelErz13-Dec-05 22:37
MarcelErz13-Dec-05 22:37 
GeneralRe: Textfile and its schema Pin
Mahi.Ragava13-Dec-05 23:01
Mahi.Ragava13-Dec-05 23:01 
GeneralRe: Textfile and its schema Pin
MarcelErz14-Dec-05 0:31
MarcelErz14-Dec-05 0:31 
QuestionSend Message Pin
picasso213-Dec-05 17:55
picasso213-Dec-05 17:55 
AnswerRe: Send Message Pin
MarcelErz13-Dec-05 22:28
MarcelErz13-Dec-05 22:28 

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.