Link to home
Start Free TrialLog in
Avatar of Epicmanagement
Epicmanagement

asked on

How do I add a ComboBox to my ASP.NET 2.0 page ? VB.NET ComboBox

VB.NET, ASP.NET.  .NET 2.0

I guess this is an easy beginner question.  I can't find the ComboBox control.

How do I drop a ComboBox control to my ASP.NET page (with a VB.NET code behind page).  I tried going to chose Toolbox Items and all ComboBox controls were checked, but I don't see it.

Or what properites can make a DropDownList work like a ComboBox (so I can type in my own value)
Avatar of Pra4444
Pra4444
Flag of United States of America image

This is how you add values at run time...

DropDownList1.items.add("anyvalue")

if you know the values before then and its not gonna change then,
<asp:dropdownlist id="DropDownList1" runat="server"  Width="97px" Font-Bold="true">
                                          <asp:ListItem Value="1">text1</asp:ListItem>
                                          <asp:ListItem Value="2">text2</asp:ListItem>
                                          <asp:ListItem Value="3">text3</asp:ListItem>
                                    </asp:dropdownlist></td>
Avatar of MHenry
MHenry

Did you try the drop down list in the toolbox? You can assign a label and a value.

Should work for you.

Best,
MH
Avatar of Elvio Lujan
the name of combobox in the toolbox is dropdownlist its the same
Avatar of Epicmanagement

ASKER

NO they are not the same.

It a Windows Application a Combo Box also lets you type in your own value so you don't have to just chose from the values in a dropdownlist.

I need the user to be able to also enter in a value that is not in the DropDown
ASKER CERTIFIED SOLUTION
Avatar of mrichmon
mrichmon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial