S
shapper
Hello,
I am creating a custom control and I need to define a custom event
with its own arguments.
I would like to use the ASP.NET standard way to do this, i.e:
Private Sub MyCustomControl_Submited(ByVal sender As Object, ByVal
e As MyCustomControlEventArgs) Handles mccTest.Submited
...
End Sub
Where "e" contains the arguments.
I created the following:
' SubmitedEventArgs
Public Class SubmitedEventArgs
Inherits EventArgs
Private _Name As String
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property ' Name
Public Sub New(ByVal name As String)
Me.Name = name
End Sub ' New
End Class
And an handler:
' SubmitedEventHandler
Public Class SubmitedEventHandler
Public Delegate Sub SubmitedEventHandler(ByVal sender As Object,
ByVal e As SubmitedEventArgs)
End Class
Is this right?
And how can make my Custom Control to define, use and raise this
event?
Thanks,
Miguel
I am creating a custom control and I need to define a custom event
with its own arguments.
I would like to use the ASP.NET standard way to do this, i.e:
Private Sub MyCustomControl_Submited(ByVal sender As Object, ByVal
e As MyCustomControlEventArgs) Handles mccTest.Submited
...
End Sub
Where "e" contains the arguments.
I created the following:
' SubmitedEventArgs
Public Class SubmitedEventArgs
Inherits EventArgs
Private _Name As String
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property ' Name
Public Sub New(ByVal name As String)
Me.Name = name
End Sub ' New
End Class
And an handler:
' SubmitedEventHandler
Public Class SubmitedEventHandler
Public Delegate Sub SubmitedEventHandler(ByVal sender As Object,
ByVal e As SubmitedEventArgs)
End Class
Is this right?
And how can make my Custom Control to define, use and raise this
event?
Thanks,
Miguel