Hi,
The event that triggers a set to defaultValue of an integerUpDown when "Empty" is the "Text" value is :
TextBox.LostFocus
where "TextBox" is the WatermarkTextBox included in the template of a NumericUpDown control.
In other word, when the focus shift away from the IntegerUpDown, it will sync the "Text" and "Value" property : in this case to the "Default" Value, via the "ComitInput()" method.
What you could do is define your own IntegerUpDown and call "ComitInput()" when mouse leaves the control :
The event that triggers a set to defaultValue of an integerUpDown when "Empty" is the "Text" value is :
TextBox.LostFocus
where "TextBox" is the WatermarkTextBox included in the template of a NumericUpDown control.
In other word, when the focus shift away from the IntegerUpDown, it will sync the "Text" and "Value" property : in this case to the "Default" Value, via the "ComitInput()" method.
What you could do is define your own IntegerUpDown and call "ComitInput()" when mouse leaves the control :
public class MyIntegerUpDown : IntegerUpDown
{
public MyIntegerUpDown()
{
Mouse.AddMouseLeaveHandler( this, OnMouseLeave );
}
private void OnMouseLeave( object sender, MouseEventArgs e )
{
this.CommitInput();
}
}