Example #1
0
        private void mtb_dtr_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
        {
            /*    if (!e.IsValidInput)
             *  {
             *      tt_dtr.ToolTipTitle = "Invalid Date";
             *      tt_dtr.Show("Manila Date & Time. Format: dd/MM/yyyy HH:mm.", mtb_dtr, 0, -20, 2000);
             *  }
             *  else
             *  {
             *      //Now that the type has passed basic type validation, enforce more specific type rules.
             *      DateTime userDate = (DateTime)e.ReturnValue;
             *      if (userDate > DateTime.Now)
             *      {
             *          tt_dtr.ToolTipTitle = "Invalid Date";
             *          tt_dtr.Show("Manila Date & Time. Format: dd/MM/yyyy HH:mm.", mtb_dtr, 0, -20, 2000);
             *          e.Cancel = true;
             *      }
             *      else
             *      {
             */
            //tx_ticket.Select();
            //tx_ticket.ReadOnly = false;
            //cb_status.Enabled = false;

            /*      }
             * }
             */
        }
 private void IPaddress_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (IPaddress.MaskCompleted)
     {
         IPvalid = true;
     }
 }
Example #3
0
 /// <summary>
 /// Raises the TypeValidationCompleted event.
 /// </summary>
 /// <param name="e">An EventArgs that contains the event data.</param>
 protected virtual void OnTypeValidationCompleted(TypeValidationEventArgs e)
 {
     if (TypeValidationCompleted != null)
     {
         TypeValidationCompleted(this, e);
     }
 }
Example #4
0
 private void maskedTextBox1_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         MessageBox.Show("Data inválida", "Mensagem do Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Example #5
0
        void mask_fecha_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
        {
            if (!e.IsValidInput)
            {
                toolTip1.ToolTipTitle = "Invalid Date";
                toolTip1.Show("El formato debe de ser  mm/dd/yyyy.", mask_fecha, 0, -20, 2000);
            }
            else
            {
                //Now that the type has passed basic type validation, enforce more specific type rules.
                DateTime userDate = (DateTime)e.ReturnValue;

                DateTime tiempo = Convert.ToDateTime(mask_fecha.Text);

                if (tiempo < DateTime.Today)
                {
                    toolTip1.ToolTipTitle = "Invalid Date";
                    toolTip1.Show("La cita debe ser igual o mayor a la actual.", mask_fecha, 0, -20, 2000);
                    e.Cancel = true;
                }
                else if (tiempo >= DateTime.Today)
                {
                    //MessageBox.Show("La fecha debe de ser mayor o igual a la fecha actual");
                }
                //else if(tiempo < DateTime.Now)
                //{

                //    toolTip1.ToolTipTitle = "Invalid Date";
                //    toolTip1.Show("La cita debe ser igual o mayor a la actual.", mask_fecha, 0, -20, 2000);
                //    e.Cancel = true;
                //}
            }
        }
Example #6
0
 private void mskDataNascimento_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         MessageBox.Show("Data inválida", "Sistema loja cosméticos", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #7
0
 private void mskDtVenda_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         u.messageboxDataInv();
     }
 }
Example #8
0
 private void maskedTextBox2_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         MessageBox.Show("Data inválida");
     }
 }
Example #9
0
 private void maskedTextBoxDatacon_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         u.messageboxDataInv();
     }
 }
Example #10
0
 private void mskDtVenda_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     /*if (!e.IsValidInput)
      * {
      *  MessageBox.Show("Data inválida", "Mensagem do Sistema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
      * }*/
 }
Example #11
0
 private void SecondNUmber_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         e.Cancel = true;
     }
 }
Example #12
0
 //Validar se a data foi preenchida corretamente
 //Usando o evento validationcompleted da máscara
 private void mskDataNasc_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         MessageBox.Show("Data Inválida.", "Sistema Loja de Cosméticos", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Example #13
0
 private void maskedTextBox2_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (maskedTextBox2.Visible == true)
     {
         if (maskedTextBox2.TextLength > 4)
         {
             epB.SetError(maskedTextBox2, "Слишком длинное значение!");
             btnCompute.Enabled = false;
         }
         else if (!e.IsValidInput)
         {
             epB.SetError(maskedTextBox2, "Invalid Data Value");
             btnCompute.Enabled = false;
         }
         else if ((maskedTextBox2.Text.Contains('-')) | (maskedTextBox2.Text.Contains('+')) | (maskedTextBox2.Text.Equals("0")))
         {
             btnCompute.Enabled = false;
             epB.SetError(maskedTextBox2, "Invalid Data Value");
         }
         else
         {
             epB.Clear();
         }
     }
 }
 private void mskNascimento_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         MessageBox.Show("Data inválida!");
     }
 }
 private void txtHorario_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (e.IsValidInput)
     {
         if (txtHorario.Text.Split(':')[1] != "00" && txtHorario.Text.Split(':')[1] != "30")
         {
             strHorarioFiltro = "";
             MessageBox.Show("Horário informado deve estar no intervalo de 30 minutos.", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtHorario.Focus();
         }
         else
         {
             strHorarioFiltro = txtHorario.Text;
             CarregaGrid();
         }
     }
     else if (txtHorario.Text.Replace(":", "").Trim() != "")
     {
         MessageBox.Show("Horário Informado inválido", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information);
         strHorarioFiltro = "";
         txtHorario.Focus();
     }
     else if (txtHorario.Text.Replace(":", "").Trim() == "" && strHorarioFiltro != "")
     {
         strHorarioFiltro = "";
         CarregaGrid();
     }
 }
Example #16
0
 private void maskedTextBox1_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!CheckDate(this.maskedTextBox1.Text))
     {
         toolTip1.Show("请输入合法日期!", maskedTextBox1, 1000);
         e.Cancel = true;
     }
 }
Example #17
0
 private static void maskedTextBox1_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         MaskedTextBox box = sender as MaskedTextBox;
         box.Tag = e.Message;
     }
 }
 void mTBNascimento_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         mtxbNascimento.Clear();
         mtxbNascimento.Focus();
     }
 }
Example #19
0
 void validateTes(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         toolTip1.ToolTipTitle = "Invalid date";
         toolTip1.Show("Format tanggal dd-MM-yyyy", maskedTextBox1, maskedTextBox1.Location, 5000);
     }
 }
Example #20
0
 private void CedulaMaskedTextBox_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         toolTip1.ToolTipTitle = "Cedula Invalida";
         toolTip1.Show("Ingrese la cedual en el formato de 056-8967547-8", CedulaMaskedTextBox, 0, -20, 5000);
     }
 }
Example #21
0
 private void TextBoxData_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         TextBoxData.Text = "";
         e.Cancel         = true;
     }
 }
Example #22
0
 /// <summary>
 /// Valida que la fecha ingresada sea correcta.
 /// </summary>
 public static void Error(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         new ToolTip().Show("El formato debe ser el sig dd/mm/yyyy.", sender as Control, 5000);
         e.Cancel = true;
     }
 }
Example #23
0
 private void maskedTextBox_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     //if (!e.IsValidInput)
     //{
     //    toolTip1.ToolTipTitle = "Ungültiges Datum";
     //    toolTip1.Show("Das Datum muss im Format dd/mm/yyyy eingegeben werden.", maskedTextBox, 0, -20, 5000);
     //}
 }
        void IPAdress_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
        {
            string ip = maskedTextBox_IPconnection.Text;

            ip = ip.Replace(@",", @".");
            ip = ip.Replace(@" ", @"0");
            maskedTextBox_IPconnection.Text = ip;
        }
 private void msk_FechaDeRemito_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         //toolTip1.ToolTipTitle = "Fecha no valida";
         //toolTip1.Show("La fecha ingresado no es valida, por favor ingrese con el siguiente formato dd/mm/aaaa", msk_FechaDeRemito);
     }
 }
 private void tbIP_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         ipTbToolTip.ToolTipTitle = "Неверный IP";
         ipTbToolTip.Show("Неверный ввод IP адреса системы", tbIP, 0, -20, 5000);
     }
 }
Example #27
0
 private void NascimentoMaskedBox_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput && !nascimentoMaskedBox.Text.Equals("__/__/____"))
     {
         MessageBox.Show("Data de nascimento inválida.\n" +
                         "Ex. de data válida DD/MM/AAAA");
     }
 }
Example #28
0
 private void mskDateTaken_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         DialogResult result = MessageBox.Show("The Date Taken entry is invalid or " + "in the future and may be ignored." + " Do you wish to correct this?", "Photo Properties", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         e.Cancel = (result == DialogResult.Yes);
     }
 }
Example #29
0
        public void Cancel_Set_GetReturnsExpected(bool value)
        {
            var e = new TypeValidationEventArgs(typeof(int), true, "returnValue", "message")
            {
                Cancel = value
            };

            Assert.Equal(value, e.Cancel);
        }
Example #30
0
 public void maskedTextBox2_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
 {
     if (!e.IsValidInput)
     {
         toolTip1.ToolTipTitle = "Invalid Date Value";
         toolTip1.Show("We're sorry, but the value you entered is not a valid date. Please change the value.", maskedTextBox1, 5000);
         e.Cancel = true;
     }
 }
Example #31
0
 protected virtual void OnTypeValidationCompleted(TypeValidationEventArgs e)
 {
     if (this.TypeValidationCompleted != null)
     {
         this.TypeValidationCompleted(this, e);
     }
 }
Example #32
0
 private object PerformTypeValidation(CancelEventArgs e)
 {
     object returnValue = null;
     if (this.m_validatingType != null)
     {
         string message = null;
         if ((this.Mask.Length > 0) && !this.MaskedTextProvider.MaskCompleted)
         {
             message = MaskInputIncompleteMsg;
         }
         else
         {
             try
             {
                 returnValue = this.ValidateType(this.MaskedTextProvider.ToString(false, this.m_provider.IncludeLiterals), this.m_validatingType, this.m_formatProvider);
             }
             catch (Exception innerException)
             {
                 if (innerException.InnerException != null)
                 {
                     innerException = innerException.InnerException;
                 }
                 message = innerException.GetType().ToString() + ": " + innerException.Message;
             }
         }
         bool isValidInput = false;
         if (message == null)
         {
             isValidInput = true;
             message = TypeValidationSucceeded;
         }
         TypeValidationEventArgs args = new TypeValidationEventArgs(this.m_validatingType, isValidInput, returnValue, message);
         this.OnTypeValidationCompleted(args);
         if (e != null)
         {
             e.Cancel = args.Cancel;
         }
     }
     return returnValue;
 }