By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,463 Members | 2,858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,463 IT Pros & Developers. It's quick & easy.

combobox, clearing text field problem

P: n/a
i'm loading a combobox from a database in code, by setting the the DataSouce
to a table, and the DisplayMember to a field.

it loads the first row into the text area of the combobox automatically. i
don't want that.

i used to clear it up by setting ComboBox1.Text="", after loading it.

but i had to put the combobox on a tab page of a tab control.
ComboBox1.Text="" works only if the tab page has the focus when that code
executs! how bizzare. i have to load a few comboboxes living on separate tab
pages, and it would be unisightly to change the focus back and forth while
the user is on a specific page.

how can i

1) either load a combobox in code without setting the text area,

2) or clearing the text area of a combobox on a tab page without the page
having the focus



Jul 31 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
found the solution, which is to set SelectedIndex = -1
Aug 1 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.