moving items between a listbox and combobox. -
02-26-2004
, 06:06 PM
I'm trying to move items back and forth between a listbox and combobox, and this is what I have so far. It works fine to move items from the combobox to the listbox, but I get a System.ArgumentNullException error when I try to go the other direction. Any help would be appreciated
private void stateListBox_SelectedIndexChanged(object sender, System.EventArgs e
stateComboBox.Items.Add ( stateListBox.SelectedItem )
stateListBox.Items.Remove ( stateListBox.SelectedItem )
private void stateComboBox_SelectedIndexChanged(object sender, System.EventArgs e
stateListBox.Items.Add ( stateComboBox.SelectedItem )
stateComboBox.Items.Remove ( stateComboBox.SelectedItem )
} |