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

x
?
Solved

Clearing the selection in a Winform Combobox of type: DropDownList

Posted on 2007-11-29
2
Medium Priority
?
906 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 500 total points
ID: 20379980
this also works:
comboBox1.SelectedItem = null;
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

868 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