How to pass args for events

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • spaulsamin@yahoo.co.in

    How to pass args for events

    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.Componen tModel.CancelEv entArgs) Handles MyBase.Validati ng
    If Me.Text = "" Then
    e.Cancel = True
    showerr("Only Alphabets")
    Me.Focus()
    End If
    End Sub

    Thanks

  • rowe_newsgroups

    #2
    Re: How to pass args for events

    On Apr 27, 7:40 am, spaulsa...@yaho o.co.in wrote:
    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.Componen tModel.CancelEv entArgs) Handles MyBase.Validati ng
    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.OnValida ting(New
    System.Componen tModel.CancelEv entArgs())

    Thanks,

    Seth Rowe

    Comment

    Working...