AerolineaFrba.Validacion.estaSeleccionado C# (CSharp) Method

estaSeleccionado() public static method

public static estaSeleccionado ( ComboBox combo, System.Boolean mostrarMensaje = false, String opcional = "opciones" ) : System.Boolean
combo System.Windows.Forms.ComboBox
mostrarMensaje System.Boolean
opcional String
return System.Boolean
        public static Boolean estaSeleccionado(ComboBox combo , Boolean mostrarMensaje = false , String opcional = "opciones")
        {
            if (combo.SelectedIndex == -1)
            {
                if (mostrarMensaje)
                {
                    MessageBox.Show("Debe seleccionar un campo en el desplegable de " + opcional, "Error en el campo", MessageBoxButtons.OK);
                }
                return false;
            }
            return true;
        }