Ejemplo n.º 1
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            textBox1.SetWatermark("No purpose");
            IntTextBox.SetWatermark("Numbers only or else");
            IntTextBox.Text = "10";
            intLabel.Text   = $"{IntTextBox.IntValue()}";

            if (selectedRadioGroupBox.HasRadioButtons())
            {
                selectedRadioGroupBox.Controls.OfType <RadioButton>()
                .FirstOrDefault(rb => rb.Text == "C#").Checked = true;
            }


            ActiveControl = exitButton;
        }
 /// <summary>
 /// Repositionne le contenu du TextBox quand il perd le focus
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TextBox_LostFocus(object sender, RoutedEventArgs e)
 {
     IntTextBox.Text = GetValue(ValueProperty).ToString();
     IntTextBox.ScrollToHorizontalOffset(double.MinValue);
 }