检测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...
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); }
[解决办法]