PC Review


Reply
Thread Tools Rate Thread

combobox text- different than items collection?

 
 
confused_newbie
Guest
Posts: n/a
 
      9th Nov 2003
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!


 
Reply With Quote
 
 
 
 
MichaelLipp[MS]
Guest
Posts: n/a
 
      15th Nov 2003
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.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd Combobox behavior with multiple identical collection items mmcd79@tampabay.rr.com Microsoft Dot NET Framework Forms 0 22nd Jun 2007 03:32 AM
weird problem with ComboBox - DataSource contains data, but the Items collection stays empty nphc67@gmail.com Microsoft Dot NET Framework Forms 1 28th May 2007 08:50 AM
ComboBox.Items.Clear() causes the selection of Text inside the edit of the ComboBox Nomasnd Microsoft Dot NET Framework Forms 1 27th Sep 2006 06:32 PM
Help with combobox databinding and Items (collection) Rick Shaw Microsoft C# .NET 1 10th Aug 2006 06:22 AM
combobox items collection display snafu Dan Microsoft C# .NET 2 25th Oct 2005 10:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:50 AM.