WPF ButtonSpinner

WPF ButtonSpinner

First Adding Reference to WPF Toolkit Extended Assembly



 <wpfx:ButtonSpinner Spin="ButtonSpinner_Spin" Height="25" Width="150">
            <TextBox x:Name="txtBox" Text="0" HorizontalContentAlignment="Right" />
        </wpfx:ButtonSpinner>



 private void ButtonSpinner_Spin(object sender, Microsoft.Windows.Controls.SpinEventArgs e)
        {
            int value = String.IsNullOrEmpty(txtBox.Text) ? 0 : Convert.ToInt32(txtBox.Text);
            if (e.Direction == Microsoft.Windows.Controls.SpinDirection.Increase)
                value++;
            else
                value--;
            txtBox.Text = value.ToString();
        }

Output
WPF ButtonSpinner
WPF ButtonSpinner WPF ButtonSpinner Reviewed by Bhaumik Patel on 12:07 AM Rating: 5