Devfly
Devfly

Reputation: 2495

Event Handles Button.Click

Hello here is what i want to do:

Private Sub UpdateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateButton.Click
        MyUpdate.CheckUpdate("version.txt")
        If MyUpdate.CurrentVersion < MyUpdate.UpdateVersion Then
            'IF USER PRESS THE BUTTON TO RAISE EVENT ONE MORE TIME

        Else
           'DO NOTHING
        End If
    End Sub

I don't know how to raise an event within an event. Thank you!

Upvotes: 0

Views: 691

Answers (1)

Cody Gray
Cody Gray

Reputation: 244712

Intuitively enough, you use the RaiseEvent keyword.

More explanation about raising and consuming events in VB.NET can be found here on MSDN.

But in this case it's probably better to refactor your code and extract the logic out of event handler method into another function.

Upvotes: 2

Related Questions