combobox text- different than items collection?

  • Thread starter Thread starter confused_newbie
  • Start date Start date
C

confused_newbie

I am successfully loading the contents of eleven comboboxes during runtime.
[tmpControl.Items.Add (valuearray(i,r))]

I'd like to add a simple prompt in each combobox, like "select a color",
"select an animal", etc. The prompt also needs to be loaded at runtime from
the same file (which is pre-loaded into an array)

I tried variations on:
tmpControl.text = valuearray(i,0)

and I confirmed valuearray(i,0) has the right strings

I also reviewed various commands like
tmpcontrol.text.clone
tmpcontrol.text.insert

but they don't appear to be what I need, because at runtime (in the
emulator) the comboboxes stay blank, which (with 9 onscreen) will be
confusing for a user.

any help greatly appreciated!
 
why can't your code add the prompts (after the call to
InitializeComponent() or something) before it loads the items from the file?

If that's not an option, one way to do it might be to subclass the comboBox
and in your subclass's constructor (before any items get added) load the
prompt item (maybe via constructor parameter).



NETCF Beta FAQ's -- http://www.gotdotnet.com/team/netcf/FAQ.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top