المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : adding data to combo box from menu item



C# Programming
01-18-2010, 12:36 AM
namespace example
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void addEmployeeNumberToolStripMenuItem_Click(object sender, EventArgs e)
{
//this.comboBox1.Items.Add(textBox1.Text);

}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}
}
Hello, I have a form with one combobox on it- and menu item: addEmployeeNumber.
is there a way to click employeeNumber toolstrip menu and have a text box display and then once filled with data -it can be added to combobox- or another way- my code this.comboBox1. items. add ( textbox1.text); is not working the right way.