如何从其他事件过程中检查是否处理了事件? [英] How to check if event an was handled, from a different event procedure?
本文介绍了如何从其他事件过程中检查是否处理了事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检查某个事件是否由其他事件过程处理?
How can I check if an event was handled from a different event procedure?
例如
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged
End Sub
Private Sub ComboBox1_DropDownClosed(sender As Object, e As EventArgs) Handles ToolStripComboBox1.DropDownClosed, ToolStripComboBox1.SelectedIndexChanged
IF ComboBox1_SelectedIndexChanged ? THEN ....
End Sub
推荐答案
如何检查某个事件是否是通过其他事件过程处理的?
How can I check if an event was handled from a different event procedure?
例如
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged
End Sub
Private Sub ComboBox1_DropDownClosed(sender As Object, e As EventArgs) Handles ToolStripComboBox1.DropDownClosed, ToolStripComboBox1.SelectedIndexChanged
IF ComboBox1_SelectedIndexChanged ? THEN ....
End Sub
消费者(您的表单的类)可以订阅所有订阅者,并且所有订阅者都将做出响应,所以这根本不是一个或任何一种情况.
The consumer (your form's class) can subscribe to all of them and all of them will respond, so it's not an either/or situation at all.
这篇关于如何从其他事件过程中检查是否处理了事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文