コード例 #1
0
        private void TrainingHorizonTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e)
        {
            int trainingHorizon;

            if (!int.TryParse(TrainingHorizonTextBox.Text, out trainingHorizon))
            {
                e.Cancel = true;
                TrainingHorizonErrorProvider.SetError(TrainingHorizonTextBox, "Please enter a numeric value.");
                TrainingHorizonTextBox.SelectAll();
            }
        }
コード例 #2
0
 private void TrainingHorizonTextBox_Validated(object sender, System.EventArgs e)
 {
     Content.TrainingHorizon = int.Parse(TrainingHorizonTextBox.Text);
     TrainingHorizonErrorProvider.SetError(TrainingHorizonTextBox, string.Empty);
     TrainingHorizonTextBox.Text = Content.TrainingHorizon.ToString();
 }