hi all....please do help me...am stuck with this problem....
There are 2 forms.
In one form(form1),there are 3 textboxes(tb1,tb2,tb3) and corresponding to each there is a button..i.e: for tb1-btn1,tb2-btn2,and tb3-btn3
In second form(form2),there is one textbox(tb4) and one button(btn4)...
When i click on a button(say btn1)in form1,form2 should be displayed.and when some text is entered in textbox(tb4) and button(btn4) is clicked that text should be displayed in the textbox(tb1) in form1 which is corresponding to the button(btn1) clicked first.......like that for btn2 and btn3....The prob is what i enter in tb4 is displaying in all 3 textboxes(tb1,tb2,tb3)...
I dont want it like dat....What i want is....When btn1 is clicked value must be displayed only in tb1,similarly when btn2 is clicked value must be shown in tb2....and so for btn3...
This is in C#.net Windows Application
Here is the code i tried......
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.Show();
}
internal void valuefromform2(string p)
{
textBox1.Text = p;
}
}
}
public partial class Form2 : Form
{
Form1 f1;
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (f1 == null)
f1 = new Form1();
f1.valuefromform2(textBox1.Text);
f1.Show();
}
}
pls do help me....am stuck here...without this i cant go further in my project...pls pls...