C# Programming
01-18-2010, 08:11 PM
namespace Passing_Data
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2(textBox1.Text);
frm.Show();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
FORM 2:
namespace Passing_Data
{
public partial class Form2 : Form
{
public Form2(String strTextBox)
{
InitializeComponent();
label1.Text = strTextBox;
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}
this code allows me to enter data in textbox on first form and hit button and see it displayed on second form in label.
is there a way to enter data in textbos on first form and hit button and see data entered into combobox on second form?
thank you
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2(textBox1.Text);
frm.Show();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
FORM 2:
namespace Passing_Data
{
public partial class Form2 : Form
{
public Form2(String strTextBox)
{
InitializeComponent();
label1.Text = strTextBox;
}
private void Form2_Load(object sender, EventArgs e)
{
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}
this code allows me to enter data in textbox on first form and hit button and see it displayed on second form in label.
is there a way to enter data in textbos on first form and hit button and see data entered into combobox on second form?
thank you