If no selection is made, then the target of the switch() statement is null - comboBox1.SelectedItem is uninitialized, so you can't call the ToString() method on it. change the if -else statement to:
if (checkBox1.Checked != true)
{
...
}
else if (checkBox1.SelectedItem != null)
{
switch (comboBox1.SelectedItem.ToString())
{
....
}
}
else
{
MessageBox.Show("Please select a website to search.");
}
Last modified: Sunday, June 04, 2006 6:20:40 PM --