private void numericUpDown2_ValueChanged(object sender, EventArgs e)
{
this.textBox2.Text = this.numericUpDown1.Value.ToString();
}
我改变numericUpDown上下的值,发现this.textBox2.Text的值并没有随其改变
请问为什么,我如果想随着numericUpDown的Value改变而改变this.textBox2.Text,请问该怎么做
{
this.textBox2.Text = this.numericUpDown1.Value.ToString();
}
我改变numericUpDown上下的值,发现this.textBox2.Text的值并没有随其改变
请问为什么,我如果想随着numericUpDown的Value改变而改变this.textBox2.Text,请问该怎么做
2.Text属性也不会变化么?
我刚测试过,没有任何问题,由于NumericUpDown是一个复合控件,所以一点击上下的箭头,Value的改变立刻就能反映到TextBox中。
然后重写OnPaint方法,在方法里赋值!
请教怎么用?
我的问题可能就出在不知道他是复合控件单独使用了
我们用起来都没有做特别的处理,都用得好好的。
实在不行的话,贴出你附加事件处理方法的代码。
private void numericUpDown2_ValueChanged(object sender, EventArgs e)
{
this.textBox2.Text = this.numericUpDown1.Value.ToString();
}