Click here to Skip to main content
16,021,041 members

Comments by Little Daffodil (Top 8 by date)

Little Daffodil 23-Nov-10 8:10am View    
thanks..
that's a very long article.. wow!
Little Daffodil 23-Nov-10 5:27am View    
I tried this:

if (comboBoxLabNumber.SelectedIndex < 0 | comboBoxProblem.SelectedIndex <0)
{
MessageBox.Show("Please select the lab number and the problem");
}

string LabName = comboBoxLabNumber.SelectedItem.ToString();
string LabNumber = LabName;

string LabProblem = comboBoxProblem.SelectedItem.ToString();
string LabProb = LabProblem;

Yes, it works. However, this message of "Error: Object reference not set to an instance of an objet." still comes out.
Little Daffodil 23-Nov-10 5:24am View    
I'm blur. Does it mean this way?

if (comboBoxLabNumber.SelectedIndex > -1 | comboBoxProblem.SelectedIndex > -1)
{

}
else
{
MessageBox.Show("Please select an item!");
}

string LabName = comboBoxLabNumber.SelectedItem.ToString();
string LabNumber = LabName;

string LabProblem = comboBoxProblem.SelectedItem.ToString();
string LabProb = LabProblem;
Little Daffodil 23-Nov-10 5:08am View    
I tried this:

if (comboBoxLabNumber.SelectedIndex > -1 | comboBoxProblem.SelectedIndex > -1)
{
string LabName = comboBoxLabNumber.SelectedItem.ToString();
string LabNumber = LabName;

string LabProblem = comboBoxProblem.SelectedItem.ToString();
string LabProb = LabProblem;
}
else
{
MessageBox.Show("Please select an item!");
}


However, it comes out as error : The name 'LabName' and 'LabProblem' does not exist in the current context.
Little Daffodil 19-Nov-10 0:46am View    
It worked!

Thanks a lot, Alegria_Lee.