How to pass args for events

  • Thread starter Thread starter spaulsamin
  • Start date Start date
S

spaulsamin

Hi

Please let me know how to do the following

here, i have property and event in a class, now i want to fire the
event from the property when i get value, how to pass args for the
below event

would you FILL UP THE (?) MARK .

Property required() As Boolean
Get
Return m_required
End Get
Set(ByVal Value As Boolean)
m_required = Value
If Value = True Then
EVENTVALIDATING( ? , ? )
End If
End Set
End Property

Private Sub eventvalidating(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Validating
If Me.Text = "" Then
e.Cancel = True
showerr("Only Alphabets")
Me.Focus()
End If
End Sub

Thanks
 
Hi

Please let me know how to do the following

here, i have property and event in a class, now i want to fire the
event from the property when i get value, how to pass args for the
below event

would you FILL UP THE (?) MARK .

Property required() As Boolean
Get
Return m_required
End Get
Set(ByVal Value As Boolean)
m_required = Value
If Value = True Then
EVENTVALIDATING( ? , ? )
End If
End Set
End Property

Private Sub eventvalidating(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Validating
If Me.Text = "" Then
e.Cancel = True
showerr("Only Alphabets")
Me.Focus()
End If
End Sub

Thanks

Since you're talking about calling the base object's Validating event,
you could do what the base object does and just call it's OnValidating
method:

MyBase.OnValidating(New
System.ComponentModel.CancelEventArgs())

Thanks,

Seth Rowe
 
Back
Top