HighTechTalks DotNet Forums  

moving items between a listbox and combobox.

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss moving items between a listbox and combobox. in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Matt
 
Posts: n/a

Default 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 )

}

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.