private ValueBox_MouseWheel ( object sender, System.Windows.Input.MouseWheelEventArgs e ) : void | ||
sender | object | |
e | System.Windows.Input.MouseWheelEventArgs | |
Результат | void |
private void ValueBox_MouseWheel(object sender, MouseWheelEventArgs e)
{
var textBox = sender as NumericTextBox;
if (textBox == null) return;
textBox.Value = textBox.IsHex ? Convert.ToInt64(textBox.Text.Replace("#",""), 16) : Convert.ToInt32(textBox.Text);
textBox.Value = e.Delta > 0 ? textBox.Value + 1 : textBox.Value - 1;
}