Ejemplo n.º 1
0
 private void TemperatureValueChanged(object sender, Syncfusion.WinForms.Input.Events.ValueChangedEventArgs e)
 {
     if ((sender as SfNumericTextBox).Value != null && e.NewValue != e.OldValue)
     {
         if ((sender as SfNumericTextBox).Name.Equals("celNumericTextBox"))
         {
             this.farNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value * 1.8 + 32, 2);
             this.ranNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value * 1.8 + 491.67, 2);
             this.kelNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value + 273.15, 2);
         }
         else if ((sender as SfNumericTextBox).Name.Equals("farNumericTextBox"))
         {
             this.celNumericTextBox.Value = Math.Round(((double)this.farNumericTextBox.Value - 32) / 1.8, 2);
             this.kelNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value + 273.15, 2);
             this.ranNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value * 1.8 + 491.67, 2);
         }
         else if ((sender as SfNumericTextBox).Name.Equals("kelNumericTextBox"))
         {
             this.celNumericTextBox.Value = Math.Round((double)this.kelNumericTextBox.Value - 273.15, 2);
             this.farNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value * 1.8 + 32, 2);
             this.ranNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value * 1.8 + 491.67, 2);
         }
         else if ((sender as SfNumericTextBox).Name.Equals("ranNumericTextBox"))
         {
             this.celNumericTextBox.Value = Math.Round(((double)this.ranNumericTextBox.Value - 491.67) / 1.8, 2);
             this.kelNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value + 273.15, 2);
             this.farNumericTextBox.Value = Math.Round((double)this.celNumericTextBox.Value * 1.8 + 32, 2);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Validates the control and updated the error message for <see cref="ValidationTextBox"/>.
 /// </summary>
 /// <param name="sender"><see cref="ValidationTextBox"/>.</param>
 /// <param name="e">Event args that contains new value and old value.</param>
 private void ValidationTextBox_ValueChanged(object sender, Syncfusion.WinForms.Input.Events.ValueChangedEventArgs e)
 {
     if ((this.ValidationTextBox.Value >= 1000000000 && this.ValidationTextBox.Value <= 9999999999) || this.ValidationTextBox.Value == null)
     {
         this.errorProvider.SetError(this.ValidationTextBox, string.Empty);
         this.ValidationTextBox.Style.FocusBorderColor = this.ValidationTextBox.Style.BorderColor = ColorTranslator.FromHtml("#7A7A7A");
     }
     else
     {
         this.errorProvider.SetError(this.ValidationTextBox, "Invalid mobile number.");
         this.ValidationTextBox.Style.FocusBorderColor = this.ValidationTextBox.Style.BorderColor = Color.Red;
     }
 }
Ejemplo n.º 3
0
 private void CurrencyValueChanged(object sender, Syncfusion.WinForms.Input.Events.ValueChangedEventArgs e)
 {
     if ((sender as SfNumericTextBox).Value != null && e.NewValue != e.OldValue)
     {
         if ((sender as SfNumericTextBox).Name.Equals("usNumericTextBox"))
         {
             this.turkeyTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 3.78, 2);
             this.chNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 6.21, 2);
             this.indNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 64.09, 2);
             this.japanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 123.55, 2);
             this.germanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.8905, 2);
             this.brNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.807, 2);
             this.saNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 13.39, 2);
         }
         if ((sender as SfNumericTextBox).Name.Equals("turkeyTextBox"))
         {
             this.usNumericTextBox.Value = Math.Round((double)this.turkeyTextBox.Value / 3.78, 2);
             this.chNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 6.21, 2);
             this.indNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 64.09, 2);
             this.japanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 123.55, 2);
             this.germanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.8905, 2);
             this.brNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.807, 2);
             this.saNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 13.39, 2);
         }
         if ((sender as SfNumericTextBox).Name.Equals("chNumericTextBox"))
         {
             this.usNumericTextBox.Value = Math.Round((double)this.chNumericTextBox.Value / 6.21, 2);
             this.turkeyTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 3.78, 2);
             this.indNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 64.09, 2);
             this.japanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 123.55, 2);
             this.germanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.8905, 2);
             this.brNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.807, 2);
             this.saNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 13.39, 2);
         }
         if ((sender as SfNumericTextBox).Name.Equals("japanNumericTextBox"))
         {
             this.usNumericTextBox.Value = Math.Round((double)this.japanNumericTextBox.Value / 123.55, 2);
             this.turkeyTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 3.78, 2);
             this.chNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 6.21, 2);
             this.indNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 64.09, 2);
             this.germanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.8905, 2);
             this.brNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.807, 2);
             this.saNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 13.39, 2);
         }
         if ((sender as SfNumericTextBox).Name.Equals("indNumericTextBox"))
         {
             this.usNumericTextBox.Value = Math.Round((double)this.indNumericTextBox.Value / 64.09, 2);
             this.turkeyTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 3.78, 2);
             this.chNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 6.21, 2);
             this.japanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 123.55, 2);
             this.germanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.8905, 2);
             this.brNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.807, 2);
             this.saNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 13.39, 2);
         }
         if ((sender as SfNumericTextBox).Name.Equals("germanNumericTextBox"))
         {
             this.usNumericTextBox.Value = Math.Round((double)this.germanNumericTextBox.Value / 0.8905, 2);
             this.turkeyTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 3.78, 2);
             this.chNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 6.21, 2);
             this.indNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 64.09, 2);
             this.japanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 123.55, 2);
             this.brNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.807, 2);
             this.saNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 13.39, 2);
         }
         if ((sender as SfNumericTextBox).Name.Equals("brNumericTextBox"))
         {
             this.usNumericTextBox.Value = Math.Round((double)this.brNumericTextBox.Value / 0.807, 2);
             this.turkeyTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 3.78, 2);
             this.chNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 6.21, 2);
             this.indNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 64.09, 2);
             this.japanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 123.55, 2);
             this.germanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.8905, 2);
             this.saNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 13.39, 2);
         }
         if ((sender as SfNumericTextBox).Name.Equals("saNumericTextBox"))
         {
             this.usNumericTextBox.Value = Math.Round((double)this.saNumericTextBox.Value / 13.39, 2);
             this.turkeyTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 3.78, 2);
             this.chNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 6.21, 2);
             this.indNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 64.09, 2);
             this.japanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 123.55, 2);
             this.germanNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.8905, 2);
             this.brNumericTextBox.Value = Math.Round((double)this.usNumericTextBox.Value * 0.807, 2);
         }
     }
 }