Solved

Clearing the selection in a Winform Combobox of type: DropDownList

Posted on 2007-11-29
2
894 Views
Last Modified: 2008-09-12
Hi:

I'm using a Combobox in .Net 2.0 winforms. The DropdownStyle for the combobox is set to DropDownList. When the combobox first displays, the edit portion shows a blank (indetermanite state).
I would like to programmatically reset this property so it's back to the indetermanite state.

Is there any way to do this without adding a blank ("") entry to mycollection list?

Thanks,
JohnB
0
Comment
Question by:jxbma
  • 2
2 Comments
 
LVL 7

Expert Comment

by:prosh0t
ID: 20379977
It should just be like this: comboBox1.SelectedIndex = -1;
0
 
LVL 7

Accepted Solution

by:
prosh0t earned 125 total points
ID: 20379980
this also works:
comboBox1.SelectedItem = null;
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question