Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting a default item in a DropDownList
Message
 
À
29/10/2002 10:30:32
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00716444
Message ID:
00716496
Vues:
16
This message has been marked as the solution to the initial question of the thread.
You use the SelectedIndex property of the ComboBox to set the index. The indexes are zero based so to get item 2 you use index of 1.
ComboBox1.SelectedIndex = 1;
>I created a ComboBox DropDownList with 4 items in it. I want the second item to be highlighted in the list when the WinForm displays. How do I set this?
>
>In VFP I would use ListItemID = 2. How do you do this in C#?
>
>Thanks,
>
>Jerry
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform