|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ComboBox values and ItemsComboBox1.Items.Add("Cool!") AND assign to this new Item a unique index ? As in HTML <option value="1">Cool</option> I would like to override standard indexes (0,1,2,3,...) and write mine. Is it possible? Regards. -- fabri MKDS nick & friend Code: Joker® - 055895 043343 --------------------------------- AC Nome, Citta' e codice amico: Fabrizio, Kanoemi, 1890-4700-1546 --------------------------------- ComboBox1.Items.Insert(1,"Cool!");
VJ Show quoteHide quote "FaWiizio" <n*@sp.am> wrote in message news:e3aiia$p70$1@nnrp.ngi.it... > Is it possible to add an item to a combobox this way: > > ComboBox1.Items.Add("Cool!") > > AND assign to this new Item a unique index ? > > As in HTML > > <option value="1">Cool</option> > > I would like to override standard indexes (0,1,2,3,...) and write mine. > > Is it possible? > > Regards. > > -- > fabri > MKDS nick & friend Code: > Joker® - 055895 043343 > --------------------------------- > AC Nome, Citta' e codice amico: > Fabrizio, Kanoemi, 1890-4700-1546 > --------------------------------- You can create your own class for the items. Make it contain an integer
for the index and a string. Override the ToString method to return the string, that is how the combobox gets the text to display for the item. Add objects from your class to the combobox. When the user selects an item you cast the selected item back to your class and get the index. FaWiizio wrote: Show quoteHide quote > Is it possible to add an item to a combobox this way: > > ComboBox1.Items.Add("Cool!") > > AND assign to this new Item a unique index ? > > As in HTML > > <option value="1">Cool</option> > > I would like to override standard indexes (0,1,2,3,...) and write mine. > > Is it possible? > > Regards. >
incompatibility with dotnet 2.0 and Outlook Business Contact Manager 2003
.exe from within a form clearing all the lables on a form in vb.net 2005 Attempted to read or write protected memory Saving a data table to a MS Access database Help! Something adds 1 hour to my datetimes! :-S help in search&replace for ArrayList Troubled saving a clipped region from an image to disk as transparent Help with creating Installation package under VB2005 Express Ed. System.Configuration.ConfigurationSettings.AppSettings.Get("...") |
|||||||||||||||||||||||