How to prevent value changed events from firing on form initialization in .NET?

后端 未结 10 2440
清歌不尽
清歌不尽 2020-12-03 07:01

Consider a simple .NET form with a couple of radio buttons and a checkbox.

Each of the radio buttons has a CheckedChanged handler setup that performs some action bas

10条回答
  •  清歌不尽
    2020-12-03 07:43

    Just in case anyone is still searching for this the event is fired upon initializing the form BUT the form is not yet visible, Also Say that you have a foreign key relationship upon which you have a default value needed issue that gets fired every row update too. So the following code worked for me....

        if (Visible && !(e.ColumnIndex == 0))
            {
                phoneEdited = true;
                MessageBox.Show("A Phone entry has been entered");
            }
    

提交回复
热议问题