DirListBox.OnChange(EventArgs) 方法
定义
protected:
virtual void OnChange(EventArgs ^ e);
protected virtual void OnChange (EventArgs e);
abstract member OnChange : EventArgs -> unit
override this.OnChange : EventArgs -> unit
Protected Overridable Sub OnChange (e As EventArgs)
参数
注解
引发事件时,将通过委托调用事件处理程序。Raising an event invokes the event handler through a delegate. 有关详细信息,请参阅 处理和引发事件。For more information, see Handling and Raising Events.
OnChanged方法还使派生类可以处理事件,而无需附加委托。The OnChanged method also enables derived classes to handle the event without attaching a delegate. 这是在派生类中处理事件的首选技术。This is the preferred technique for handling the event in a derived class.
备注
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 中其他命名空间的功能。In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. 只有当 Visual Basic 6.0 代码模型与 .NET Framework 实现有显著区别时,才必须使用这些函数和对象。They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.
继承者说明
当 OnChanged 在派生类中重写时,请确保调用 OnChanged 基类的方法,以便注册的委托接收事件。When overriding OnChanged in a derived class, make sure to call the OnChanged method of the base class so that registered delegates receive the event.