Solved

Clearing the selection in a Winform Combobox of type: DropDownList

Posted on 2007-11-29
2
882 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now