Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
AnswerRe: Object Oriented Graphics issue Pin
User 66585-Oct-06 5:41
User 66585-Oct-06 5:41 
AnswerRe: Object Oriented Graphics issue Pin
aamironline5-Oct-06 6:06
aamironline5-Oct-06 6:06 
GeneralRe: Object Oriented Graphics issue Pin
vineas5-Oct-06 7:36
vineas5-Oct-06 7:36 
QuestionDll to XML Pin
gmellado5-Oct-06 5:17
gmellado5-Oct-06 5:17 
QuestionDatabase Copy and Paste Pin
Spudwars5-Oct-06 4:30
Spudwars5-Oct-06 4:30 
AnswerRe: Database Copy and Paste Pin
Chris Buckett5-Oct-06 9:05
Chris Buckett5-Oct-06 9:05 
QuestionNewbie: How to use a variable from a different form? Pin
hristo19775-Oct-06 4:15
hristo19775-Oct-06 4:15 
AnswerRe: Newbie: How to use a variable from a different form? Pin
Andrei Ungureanu5-Oct-06 4:22
Andrei Ungureanu5-Oct-06 4:22 
Hy,
The easiest way to do what you need is to create a public static variable that contains the TextBox's text. I'll give you an example code. Suppose you have Form1 with TextBox1 and Form2 with Label2. When you click Button1 from Form1 you show Form2 with the text on the Label2.
//in the first form
public static string textBoxText = "";

private void Button1_Click(object sender, EventArgs e)
{
  textBoxText = TextBox1.Text;
  Form2 f = new Form2();
  f.ShowDialog();
}

//in the second form
private void Form_Load(object sender, EventArgs e)
{
 Label2.Text = Form1.textBoxText;
}


Hope it helps you.

Do your best to be the best

GeneralRe: Newbie: How to use a variable from a different form? Pin
hristo19775-Oct-06 4:35
hristo19775-Oct-06 4:35 
GeneralRe: Newbie: How to use a variable from a different form? Pin
Nadia Monalisa5-Oct-06 6:28
Nadia Monalisa5-Oct-06 6:28 
GeneralRe: Newbie: How to use a variable from a different form? Pin
hristo19775-Oct-06 10:20
hristo19775-Oct-06 10:20 
GeneralRe: Newbie: How to use a variable from a different form? Pin
Nadia Monalisa5-Oct-06 10:31
Nadia Monalisa5-Oct-06 10:31 
QuestionPdf export file does not complete page 2 if the "mode" summary option is selected Pin
Mishalin5-Oct-06 4:09
Mishalin5-Oct-06 4:09 
QuestionCrystal Reports automatically sorts my columns and rows in a cross tab Pin
Mishalin5-Oct-06 3:53
Mishalin5-Oct-06 3:53 
QuestionDrawing bitmap? Pin
Dominik Reichl5-Oct-06 2:36
Dominik Reichl5-Oct-06 2:36 
AnswerRe: Drawing bitmap? Pin
aamironline5-Oct-06 4:53
aamironline5-Oct-06 4:53 
GeneralRe: Drawing bitmap? Pin
Dominik Reichl5-Oct-06 6:43
Dominik Reichl5-Oct-06 6:43 
AnswerRe: Drawing bitmap? Pin
Insincere Dave5-Oct-06 4:58
Insincere Dave5-Oct-06 4:58 
GeneralRe: Drawing bitmap? Pin
Dominik Reichl5-Oct-06 6:43
Dominik Reichl5-Oct-06 6:43 
QuestionClient/server communication Pin
The underdog5-Oct-06 2:09
The underdog5-Oct-06 2:09 
AnswerRe: Client/server communication Pin
Andrei Ungureanu5-Oct-06 2:29
Andrei Ungureanu5-Oct-06 2:29 
GeneralRe: Client/server communication Pin
The underdog5-Oct-06 2:40
The underdog5-Oct-06 2:40 
GeneralRe: Client/server communication Pin
Andrei Ungureanu5-Oct-06 3:15
Andrei Ungureanu5-Oct-06 3:15 
GeneralRe: Client/server communication [modified] Pin
The underdog5-Oct-06 3:24
The underdog5-Oct-06 3:24 
Questionupdate dataset fields in runtime Pin
topcatalpha5-Oct-06 1:28
topcatalpha5-Oct-06 1: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.