I have a combobox + several textbox's on a form. Apparently the default behaviour for the comboxbox is to validate the content when the tab key is pressed, then move to the next control in the tab order. I would like to mimic this behavior when the 'Enter' key is pressed. So far I've done this:
private void cmbVendorList_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
MessageBox.Show("hello");
}
I need to replace the messagebox with some code that will cause the combobox to validate, then move to a textbox. Any suggestions or input on a better way to accomplish this task?
Update: I found that placing this code: 'txtMy.focus' in place of the messagebox complished this task. However that leads to ask a more general question: The focus event does not appear in the properties window of the C# environment that I'm using. I found this to be true of several properties/events I've tried to use in the past. Is it because I'm using C# 2008 Express Edition?
Loading
Vlado RaskovicPosted Feb 20, 2012, 3:19 PM
Sam HobbsPosted Sep 7, 2010, 5:50 PM
RonPosted Sep 7, 2010, 4:24 PM
Please forgive me if this seems like a dump question, as I'm new to C#.
Sam HobbsPosted Sep 7, 2010, 3:07 PM