if (OnSiteMovie.SelectedIndex == -1) OnSiteMovie.Focus(); if (OnSiteDay.SelectedIndex == -1) OnSiteDay.Focus(); if (OnSiteNr.SelectedIndex == -1) OnSiteNr.Focus(); if (OnSiteTime.SelectedIndex == -1) OnSiteTime.Focus(); if (OnSiteCategory.SelectedIndex == -1) OnSiteCategory.Focus(); else { int cCode = CreateCode(); this.CodeTextBox.Text = cCode.ToString(); }