Component.CanRaiseEvents Propiedad
Definición
Obtiene un valor que indica si el componente puede generar un evento.Gets a value indicating whether the component can raise an event.
protected:
virtual property bool CanRaiseEvents { bool get(); };
protected virtual bool CanRaiseEvents { get; }
member this.CanRaiseEvents : bool
Protected Overridable ReadOnly Property CanRaiseEvents As Boolean
Valor de propiedad
Es true
si el componente puede generar eventos; en caso contrario, es false
.true
if the component can raise events; otherwise, false
. De manera predeterminada, es true
.The default is true
.
Comentarios
La implementación predeterminada de esta propiedad siempre devuelve true
.The default implementation of this property always returns true
. Las clases que heredan de la Component clase deben invalidar esta propiedad para proporcionar la capacidad de deshabilitar la generación de eventos.Classes that inherit from the Component class should override this property to provide the ability to disable the raising of events. Por ejemplo, en la Control clase, si el control se hospeda como un control ActiveX, la CanRaiseEvents propiedad devuelve false
si el control ActiveX tiene sus eventos inmovilizados.For example, in the Control class, if the control is being hosted as an ActiveX control, the CanRaiseEvents property returns false
if the ActiveX control has its events frozen.
Notas a los desarrolladores de herederos
Si invalida este método en una clase derivada y lo cambia a Return false
, la EventHandlerList colección devuelta por la Events propiedad devuelve null
para un evento.If you override this method in a deriving class and change it to return false
, the EventHandlerList collection returned by the Events property returns null
for an event. Los eventos todavía se pueden agregar y quitar de la colección, pero la propiedad de la colección Item[Object] siempre devolverá null
.Events can still be added and removed from the collection, but the collection's Item[Object] property will always return null
.