try: private decimal currentValue;
private void Form_Load(object sender, System.EventArgs e)
{
this.currentValue = this.numericUpDown1.Value;
} private void numericUpDown1_ValueChanged(object sender, System.EventArgs e)
{
if(this.numericUpDown1.ReadOnly)
{
if(this.numericUpDown1.Value != this.currentValue)
this.numericUpDown1.Value = this.currentValue;
}
else
this.currentValue = this.numericUpDown1.Value;
}
private void Form_Load(object sender, System.EventArgs e)
{
this.currentValue = this.numericUpDown1.Value;
} private void numericUpDown1_ValueChanged(object sender, System.EventArgs e)
{
if(this.numericUpDown1.ReadOnly)
{
if(this.numericUpDown1.Value != this.currentValue)
this.numericUpDown1.Value = this.currentValue;
}
else
this.currentValue = this.numericUpDown1.Value;
}
this.numericUpDown1.Increment =(this.numericUpDown1.ReadOnly == true) ? 0 : 1;
this.numericUpDown1.Increment =this.numericUpDown1.ReadOnly ? (new System.Decimal(new int[] {0,0,0,0})) : (new System.Decimal(new int[] {1,0,0,0})) ;