In Windows Form , I Created ComboBox, when i try to Create a new name, it doesn't show any output. Instead of that it is showing " System.NullReferenceException : 'Object reference is not set to an instance of an object.
private void btnCountry_Click(object sender, EventArgs e)
{
MessageBox.Show(comboBox1.Text);
MessageBox.Show(comboBox1.SelectedItem.ToString());MessageBox.Show(comboBox1.SelectedIndex.ToString());
this.Close();
}
private void btnStates_Click(object sender, EventArgs e)
{
foreach(object obj in listBox1.SelectedItems)
{
MessageBox.Show(obj.ToString());
}
}
Laxmidhar SahooPosted Nov 1, 2018, 3:28 AM
Suraj KumarPosted Nov 1, 2018, 3:11 AM
Piyush PansuriyaPosted Nov 1, 2018, 2:22 AM
Laxmidhar SahooPosted Nov 1, 2018, 1:50 AM
Sreekanth ReddyPosted Oct 31, 2018, 11:25 PM