来自:微软 翻译:周芳
【译文】如何取消事件
在某些情况下,您可能想要一段包含在一个事件过程中的代码来取消相关的事件。例如,您可能想要在一个窗体的打开事件中包含一段取消打开事件的代码,来防止窗体在某些条件不满足的情况下打开。
你可以通过设置一个事件过程的“取消参数为真”来取消一个事件。
【原文】How to Cancel an Event
Under some circumstances, you may want to include code in an event procedure that cancels the associated event. For example, you may want to include code that cancels the Open event in an Open event procedure for a form, preventing the form from opening if certain conditions are not met.
You can cancel the following events:
You cancel an event by by setting an event procedure's Cancel argument to True.