TabControlArray.Validating 事件

定義

發生於驗證控制項時。Occurs when the control is validating.

public:
 event System::ComponentModel::CancelEventHandler ^ Validating;
public event System.ComponentModel.CancelEventHandler Validating;
member this.Validating : System.ComponentModel.CancelEventHandler 
Public Custom Event Validating As CancelEventHandler 
Public Event Validating As CancelEventHandler 

備註

當您使用鍵盤(TAB、SHIFT + TAB 等等)來變更焦點時,藉由呼叫 SelectSelectNextControl 方法,或是將 ActiveControl 屬性設定為目前的表單,焦點事件會依照下列順序發生:When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the Select or SelectNextControl methods, or by setting the ActiveControl property to the current form, focus events occur in the following order:

Enter

GotFocus

Leave

Validating

Validated

LostFocus

當您使用滑鼠或藉由呼叫 Focus 方法來變更焦點時,焦點事件會依照下列順序發生:When you change the focus by using the mouse or by calling the Focus method, focus events occur in the following order:

Enter

GotFocus

LostFocus

Leave

Validating

Validated

如果 CausesValidation 屬性設為 false,則會隱藏 ValidatingValidated 事件。If the CausesValidation property is set to false, the Validating and Validated events are suppressed.

如果在 Validating 事件委派中,CancelEventArgsCancel 屬性設定為 true,則會隱藏在 Validating 事件之後通常會發生的所有事件。If the Cancel property of the CancelEventArgs is set to true in the Validating event delegate, all events that would usually occur after the Validating event are suppressed.

如需如何處理事件的詳細資訊,請參閱處理和引發事件For more information about how to handle events, see Handling and Raising Events.

注意

Microsoft.VisualBasic.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。Functions and objects in the Microsoft.VisualBasic.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. 在大多數情況下,這些函式和物件會複製在 .NET Framework.NET Framework 的其他命名空間中可以找到的功能。In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework.NET Framework. 只有當 Visual Basic 6.0 程式碼模型與 .NET Framework.NET Framework 實作有顯著差異時,才需要這些項目。They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework.NET Framework implementation.

適用於

另請參閱