开发者

question about windows controls changed event

I have several controls on my form and on changed event the logic entity properties are changed. Is it p开发者_Go百科ossible not to implement changed event for every control,but do it in one place and update my logic entity when user is making changes on the form?


You need to subscribe to Change event of every control, but use the same event handler for all controls. For example, all textboxes can subscribe to the same Change event handler. For other control types, event handlers may have different types, so you can write one event handler per control type. You can also write single function, like OnUpdate, and call it from all event handlers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜