Click here to Skip to main content
15,902,275 members
Home / Discussions / C#
   

C#

 
GeneralRe: File & folder overlay icon using C# Pin
Tapas Saha4-Dec-13 23:30
Tapas Saha4-Dec-13 23:30 
GeneralRe: File & folder overlay icon using C# Pin
Richard MacCutchan4-Dec-13 23:34
mveRichard MacCutchan4-Dec-13 23:34 
GeneralRe: File & folder overlay icon using C# Pin
Dave Kreskowiak5-Dec-13 2:20
mveDave Kreskowiak5-Dec-13 2:20 
AnswerRe: File & folder overlay icon using C# Pin
WuRunZhe6-Dec-13 14:35
WuRunZhe6-Dec-13 14:35 
GeneralRe: File & folder overlay icon using C# Pin
Tapas Saha8-Dec-13 18:14
Tapas Saha8-Dec-13 18:14 
QuestionHow do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
_Q12_4-Dec-13 21:25
_Q12_4-Dec-13 21:25 
AnswerRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Mycroft Holmes4-Dec-13 21:31
professionalMycroft Holmes4-Dec-13 21:31 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
_Q12_5-Dec-13 0:14
_Q12_5-Dec-13 0:14 
I knew your brother, Sherlock.
the solution was interesting but none of you give it right.
I give you the credits because you suggested what to search for ... but you did not helped.
The solution:
C#
//c# pass value between forms

//Form1
	public	partial class Form1 : Form
	{
		Form2 f2;
		public Form1()
		{
			InitializeComponent();
			f2 = new Form2();//open and leave it hidden - don't show it yet
		}
		
		 private void button1_Click(object sender, EventArgs e)
		{
			f2.firstValue = textBox1.Text;
			f2.ShowDialog();//now show the form2
			//f2.Show();//does not WORK for microsoft reasons.I ask them.They don't know.
			label1.Text = f2.secondValue;
		}
	}	
		
		
		
//Form2
	public partial class Form2 : Form 
	{
		public Form2() {InitializeComponent();}
		public string firstValue,secondValue;
		
		private void Form2_Load(object sender, EventArgs e)
		{
			label1.Text = "Welcome " + firstValue;
		}
		private void button1Build_Click(object sender, EventArgs e)
		{
			secondValue = textBox1.Text;
                        this.Hide();
		}
	}

GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Richard MacCutchan5-Dec-13 0:54
mveRichard MacCutchan5-Dec-13 0:54 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
_Q12_5-Dec-13 0:58
_Q12_5-Dec-13 0:58 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
OriginalGriff5-Dec-13 1:06
mveOriginalGriff5-Dec-13 1:06 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
_Q12_5-Dec-13 1:18
_Q12_5-Dec-13 1:18 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
HobbyProggy5-Dec-13 3:25
professionalHobbyProggy5-Dec-13 3:25 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Pete O'Hanlon5-Dec-13 21:12
mvePete O'Hanlon5-Dec-13 21:12 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
HobbyProggy5-Dec-13 21:43
professionalHobbyProggy5-Dec-13 21:43 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Pete O'Hanlon5-Dec-13 22:46
mvePete O'Hanlon5-Dec-13 22:46 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Mycroft Holmes5-Dec-13 1:42
professionalMycroft Holmes5-Dec-13 1:42 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
BBatts5-Dec-13 10:29
BBatts5-Dec-13 10:29 
AnswerRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
OriginalGriff4-Dec-13 21:49
mveOriginalGriff4-Dec-13 21:49 
AnswerRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
DRAYKKO5-Dec-13 7:49
professionalDRAYKKO5-Dec-13 7:49 
AnswerRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
WuRunZhe9-Dec-13 2:41
WuRunZhe9-Dec-13 2:41 
QuestionCreate excel 97-2003 by Open XML SDK 2.5 ? Pin
emma.sun.sts4-Dec-13 15:36
emma.sun.sts4-Dec-13 15:36 
AnswerRe: Create excel 97-2003 by Open XML SDK 2.5 ? Pin
Richard MacCutchan4-Dec-13 22:16
mveRichard MacCutchan4-Dec-13 22:16 
GeneralRe: Create excel 97-2003 by Open XML SDK 2.5 ? Pin
emma.sun.sts8-Dec-13 15:22
emma.sun.sts8-Dec-13 15:22 
GeneralRe: Create excel 97-2003 by Open XML SDK 2.5 ? Pin
Richard MacCutchan8-Dec-13 22:05
mveRichard MacCutchan8-Dec-13 22:05 

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.