Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Arghhhh! Setting a combo text value
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
00990508
Message ID:
00990589
Vues:
16
Glenn,
That is very odd I just tested the code myself:
I added a combobox to my form through the designer and added the following code to the constructor of the form:
this.comboBox1.Items.Add("einar");
this.comboBox1.Items.Add("yoyo");
this.comboBox1.SelectedIndex = 1;
And it works as expected the text property of comboBox1 is now "yoyo".

Did you make any changes to the properties of the combobox?

Einar




>Thanks Einar,
>
>I tried that but it still pops the message! somehow I got something fouled.
>
>Glenn
>
>
>>Glenn,
>>Try the following code:
>>
>>cboSearchMethod.Items.Add("Products");
>>cboSearchMethod.Items.Add("Suppliers");
>>cboSearchMethod.SelectedIndex = 0;
>>
>>
>>Einar
>>
>>
>>>I am loading a combobox with only two values. After loading the CBO when I set the initial text value in the the CBO .Net spits out error 13 "Cast from sting "Products" to type double is not valid"
>>>I repeat "Arghhh!"
>>>
>>>Check this simple code please:
>>>
>>>cboSearchMethod.Items.Add("Products")
>>>cboSearchMethod.Items.Add("Suppliers")
>>>cboSearchMethod.Text = "Products"
>>>
>>>
>>>
>>>Thanks
>>>
>>>Glenn
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform