TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Joshua Chambers
NA
6
0
problem with ComboBox.DroppedDown
May 14 2008 5:55 PM
First of all, I'm using Visual Studio 2005, C#. So, I've got this ComboBox called cbPeople on a Form, and when the user types in a value and presses enter, I run a query and populate the combo box with selections, which works fine. My problem is that once the query is run, I want the drop down to be DOWN so that the user sees the selections and can choose one. So I use the DroppedDown property and set it to true.
My problem is that after the drop down drops down, immediately it goes back up again, and nothing I've managed to do has been able to keep it down! Any suggestions will be whole-heartedly appreciated!
Here's the code of my KeyPress event where the issue lies.
private void cbPeople_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (System.Char)Keys.Enter)
{
cbPeople.DataSource = _oc.SearchContacts(cbPeople.Text);
cbPeople.DroppedDown = true;
}
}
I've tried doing a cbPeople.Focus() at various points, but nothing Iv'e done has gotten that box to stay dropped down!
Thank you!
Joshua
Reply
Answers (
2
)
separate config files?
resize controls inside windows form