示例#1
0
        private void txtMerma_PreviewTextInput(object sender, TextCompositionEventArgs e)
        {
            string valor = ((DecimalUpDown)sender).Value.HasValue
                              ? ((DecimalUpDown)sender).Value.ToString()
                              : string.Empty;

            e.Handled = Extensor.ValidarSoloNumerosDecimales(e.Text, valor);
        }
示例#2
0
 /// <summary>
 /// utilizaremos el evento PreviewTextInput para validar numeros con decimales
 /// </summary>
 /// <param name="sender">objeto que implementa el método</param>
 /// <param name="e">argumentos asociados</param>
 /// <returns></returns>
 private void TxtValidarSoloNumerosDecimalesPreviewTextInput(object sender, TextCompositionEventArgs e)
 {
     e.Handled = Extensor.ValidarSoloNumerosDecimales(e.Text, ((TextBox)sender).Text);
 }
示例#3
0
        private void MermaPermitida(object sender, TextCompositionEventArgs e)
        {
            string texto = ((TextBox)sender).Text;

            e.Handled = Extensor.ValidarSoloNumerosDecimales(e.Text, texto ?? string.Empty);
        }
示例#4
0
        /// <summary>
        /// Validar número decimal limitado a 6 enteros y 2 decimales
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TxtSoloNumerosDecimalesPreviewTextInput(object sender, TextCompositionEventArgs e)
        {
            var importeTxt = (TextBox)sender;

            e.Handled = Extensor.ValidarSoloNumerosDecimales(e.Text, importeTxt.Text);
        }