|
Events: adxSuperPanel
is a passive control. Not much action. Several months ago I have seen
a request by a one of the .NET forum members to create an Image changed event in
Picture box. I have offered a complete set of code. The problem here is that adxSuperPanel
might create several dozen events, as you will see we have a "Before" value changed event and
an "After" value changed event. Instead of dozens of events we have opted to only one event with
enough properties to satisfy any taste, In .NET an event parameters are
nothing but properties of a class derived from the EventArgs class. I
coded a generic "Before" and "After" class event. I've attached the code to several
properties. You may see the example and improve your own control.
Public Class
EventArgsSuperPanel
Inherits EventArgs
Private _cancel As
Boolean = False
Private _oldValue As
Object
Private _newValue As
Object
Private _PropertyType As
Type
Private _propertyName As
String
Private _propertyContext As
Object
Public Sub New(ByVal
oldValue As Object,
ByVal newValue As Object,
ByVal _ PropertyType As Type,
ByVal propertyName As String,
ByVal propertyContext As
Object)
_oldValue = oldValue
_newValue = newValue
_PropertyType = PropertyType
_propertyName = propertyName
_propertyContext = propertyContext
End Sub
Public ReadOnly
Property PropertyType() As Type
Get
Return _PropertyType
End Get
End Property
Public ReadOnly Property PropertyName() As
String
Get
Return _propertyName
End Get
End
Property
Public ReadOnly
Property OldValue() As Object
Get
Return _oldValue
End Get
End Property
Public ReadOnly
Property Newvalue() As Object
Get
Return _newValue
End Get
End Property
Public Property Cancel() As
Boolean
Get
Return
_cancel
End Get
Set(ByVal Value
As Boolean)
_ cancel = Value
End Set
End Property
End Class
|