[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 682
  • Last Modified:

how to limit combobox to items in the list

Hi Everyone,

In a VB.NET 2005 windows application

In a combobox, I need to reject the entry if the user type/pick something different that the list.

How can I limit the user to input only items form the list?

TIA

Jorge

0
George
Asked:
George
  • 4
  • 3
1 Solution
 
jpaulinoCommented:
You can change the DropDownStyle to DropDownList
Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList

Open in new window

0
 
GeorgeAuthor Commented:
Hi JPaulino

Thank you for your response,

For some reason is not preventing form inputting any value that I want, despite that the property  DropDownStyle is selected to  DropDownList

Is there any other setting that I have to adjust?

TIA
0
 
jpaulinoCommented:
You can use the keys to jump to some item but you cannot write a new one, right ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GeorgeAuthor Commented:
Ok I placed the

Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList

in the event Enter of the DropDown and now is working .... , but The problem is that I need the autocomplete....
   
     cmbCommunity.AutoCompleteMode = AutoCompleteMode.SuggestAppend
     cmbCommunity.AutoCompleteSource = AutoCompleteSource.ListItems

Is there a way to have both functionalites ? limit to list and aswell autocomplete?

TIA
0
 
jpaulinoCommented:
How do you define the itens for the combobox ?
0
 
GeorgeAuthor Commented:
Thank you very much, the examples gave the ideas on how to make it work.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now