Pressing the ENTER key through a Window form is hanging on combox

Dec 12 2005 3:35 PM

When the user presses the ENTER key after each data input I am changing the ACTIVECONTROL to take the user to the next input.
The code is working on a textbox. However when I hit a combox the form will not allow me to move from the combox. I can even tab out of the combox.

Here is the code that I am using. What do I need to change to make this work.

public void GotoGetNextControl(string nextcontrolname)
{
  switch (nextcontrolname)
  {
    case "mTypesetLayoutId":
//TextBox
      this.ActiveControl = mTypesetLayoutId;
      break;
    case "mTxtDescription":
//TextBox
      this.ActiveControl = mCmbTypeOption;
      break;
    case "mCmbTypeOption":
//Combox
      this.ActiveControl = mApplicationAvailableListBox;
      break;
    default:
      this.ActiveControl = mTxtDescription;
      break;
   }
   if(this.ActiveControl != null)
   {
     this.GetNextControl(this,true);
   }
}