Pocket PC Thoughts - Daily News, Views, Rants and Raves

Check out the hottest Windows Mobile devices at our Expansys store!





Go Back   Thoughts Media Forums > POCKET PC THOUGHTS > Pocket PC Developer

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2005, 02:37 PM
Pupil
Join Date: Apr 2004
Posts: 14
Default PPC2003 vb.net

I am trying to programitcally build combo boxes onto a form.

I can successfully build the control and add items into the combo boxes.

However, when built, it seems that only the .SelectedIndex and .SelectedItem properties have values. I would also like to store some information in the .SelectedValue property.

I can see no way of specifying this when adding items into my combo box

ie. using objCombo.Items.Add("paul") before calling Controls.Add(objCombo)

Am I missing something obvious?

Any help appreciated!

Thanks,
pdanford
 
Reply With Quote
  #2 (permalink)  
Old 02-23-2005, 02:42 PM
Philosopher
Join Date: Jan 2004
Posts: 598
Send a message via AIM to Wiggster Send a message via MSN to Wiggster

If you want to add a value to the form, you need to add an object with that value.

I'm at work right now, and only have Visual Studio at home, but I'll try and give you a little direction: make your own struct or class, with a text field and whatever other values you want. Then make a ToString function, which returns the string member of the class. Then, whenever you're adding something, add a new object using your custom class. If I'm not mistaken, it'll use the ToString() property from the object to display the text, and you can access the selected item to get any public properties, functions, or variables therein.

Sorry for being vague, I'll try and have a working example tonight.
__________________
Wiggy
 
Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 06:57 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 RC7