NumericUpDown控件ValueChanged事件获取的数值是上一次数据的问题解决

Winform 上添加 NumericUpDown 控件  事件代码如下:


        Private Sub NumericUpDown_Line_ValueChanged(sender As System.Object, e As EventArgs) Handles NumericUpDown_Line.ValueChanged

            For Each serie As Series In Chart_View.Series
                int num = NumericUpDown_Line.Text
            Next

        End Sub

这么写代码的话,架设当前控件值是3,点击增加后,正常应该获取到4的,可是通过.Text属性还是获取到3.

正确写法如下:


        Private Sub NumericUpDown_Line_ValueChanged(sender As System.Object, e As EventArgs) Handles NumericUpDown_Line.ValueChanged

            For Each serie As Series In Chart_View.Series
                int num = NumericUpDown_Line.Value
            Next

        End Sub

将.Text 缓冲.Value

自己Mark下。

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页