Experts, I am trying to learn about events. I have a class that I am using and I have run into something that i cant figure out. I cannot get the onConnected sub to show up when i instantiate the class. I also want the e.eventargs to have the value of the IPAddress. Can you please help me out here?
Public Class Class2 Public Delegate Sub EventHandler(ByVal sender As Object, ByVal e As EventArgs) Public Event Connected As EventHandler Private intIndex As Integer Private strIP As String Public Property index As Integer Get Return intIndex End Get Set(value As Integer) intIndex = value End Set End Property Public Property ip As String Get Return strIP End Get Set(value As String) strIP = value onConnect(New ipPropertyChangedEventArgs(value)) End Set End Property Protected Overridable Sub onConnect(e As ipPropertyChangedEventArgs) RaiseEvent Connected(Me, e) End Sub Public Class ipPropertyChangedEventArgs Inherits EventArgs Private ReadOnly _proposedValue As String Public ReadOnly Property ProposedValue() As String Get Return Me._proposedValue End Get End Property Public Sub New(ByVal proposedValue As String) Me._proposedValue = proposedValue End Sub End ClassEnd Class
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.