Hello,
I have a textbox and button on form1.
I have a label and combobox on form2.
right now the code lets me enter data in textbox an click button to open form2 and have it displayed in label.
But I cannot figure out how to add it to the combobox.
I have tried combobox1.item.add(strTextBox) in form2 load - but not working
thank you
FORM 2:Code: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) { } } }
Code: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) { } } }



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks