With Tables("凭证")
If .Current IsNot Nothing
If .Current.IsNull("经手人") Then
MessageBox.Show("请先选择经手人","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
For Each itm As RibbonMenu.ContextCommand In e.ContextMenu.Items
itm.Visible = False
Next
Else
For Each itm As RibbonMenu.RibbonItem In e.ContextMenu.Items
itm.Visible = True
Next
End If
End If
End With
上面的代码是不是繁琐了,还有别的写法吗?