Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在复合控件中,如何在内部触发事件?
IE。我填充了一些数据,看到它处于正确的状态(只有一个项目),然后触发我的项目选择事件,调用源页面的 OnItemSelected 事件。
谢谢,
一些控件实现了 ISupportInitialize 接口,该接口具有 BeginInit()/EndInit() 方法。如果您正在对控件进行批量更新,您可以使用 BeginInit() 阻止事件,并在完成后调用 EndInit()。最后,您将所选项目设置为触发事件或直接调用事件。