首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

检测form内,数据变动,该如何处理

2012-01-19 
检测form内,数据变动可以一个一个判断textchanged,有没简单一点的方法检测form内,数据变动, 包括datagridv

检测form内,数据变动
可以一个一个判断textchanged,
有没简单一点的方法检测form内,数据变动, 包括datagridview控件

请教
谢谢

[解决办法]
Sorry, it does not work to sink to the form's Validating event.
There is a thread on http://bytes.com/groups/net-vb/362101-how-does-validation-work-winforms discussing the firing of form's Validating event, however, no conlusion was get there.

My next solution would be something like below, however, it's poor anyway, waiting for gurus...

C# code
protected override void OnLoad(EventArgs e) {            base.OnLoad(e);            foreach (Control control in Controls) {                if(control.CausesValidation) {                    control.Validating += new CancelEventHandler(control_Validating);                }            }        }        void control_Validating(object sender, CancelEventArgs e)        {            Console.WriteLine(sender);        }
[解决办法]
探讨
Sorry, it does not work to sink to the form's Validating event.
There is a thread on http://bytes.com/groups/net-vb/362101-how-does-validation-work-winforms discussing the firing of form's Validating event, however, no conlusion was get there.

My next solution would be something like below, however, it's poor anyway, waiting for gurus...

C# codeprotected override void OnLoad(EventArgs …

[解决办法]
探讨
引用:
Sorry, it does not work to sink to the form's Validating event.
There is a thread on http://bytes.com/groups/net-vb/362101-how-does-validation-work-winforms discussing the firing of form's Validating event, however, no conlusion was get there.

My next solution would be something like below, however, it's poor anyway, waiting for gurus...

C# codeprotected overr…

热点排行