Question Need Help With List Box Text

fantity

Active member
Joined
Mar 10, 2012
Messages
27
Programming Experience
Beginner
I am making an application that sends text messages to cell phones. I have a listbox that has different phone providers like Koodo. How do I make it so if Koodo is chosen it sends a message to msg.koodomobile.com instead of trying to send it to "koodo"
 
You should define a class or structure that has properties for both the friendly name and the address. You can then make a list containing instances of that type and bind it to your ListBox. You would set the DisplayMember to the name of the property containing the friendly name and the ValueMember to the name of the property containing the address, then assign the list to the DataSource. The user will then see all the friendly names but, when they select an item, you can get the corresponding address from the SelectedValue.
 
Back
Top