所以我有一个带有 SelectedIndexChanged 事件处理程序的组合框:
Private Sub cmbStatus_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbStatus.SelectedIndexChanged
DoAnnoyingStuff()
'....
End sub
在我的表单的其他地方,我有一个执行此操作的函数(在一些用户交互之后):
Sub RefreshStatus()
Dim sel As Int32 = GetNewStatus()
cmbStatus.SelectedIndex = sel '<-- fires a SelectedIndexChanged event that I don't need
End Sub
我想要在 RefreshStatus() 中做的是更改组合框中显示的选择,但不执行 DoAnnoyingStuff()。我该怎么做呢?