Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# to VB.NET

Status
Not open for further replies.

sbelgium

Programmer
Mar 31, 2005
5
BE
Hey,

I have a program in C# but I want to convert it into VB.NET.

I have a problem with this code:

In the c# class: eIDClient.cs:
public event MessageReceived eventReceiving;

In another c# class:
theClient = new eIDclient();
this.theClient.eventAdding += new AddClient(theClient_eventAdding);


Now in VB.NET (used eIDClient as Reference)
I try to do this.

Dim theClient As New eID()
me.theClient.eventAdding += new AddClient(theClient_eventAdding)


private sub theClient_eventAdding()

Me.btnLogin.text="Disconnect"

end sub

Unfortunately I get an error. I know that my problem isn't explained clearly...

Thanks
 
Well what kind of error do you get?

Right off the bat I see this:
theClient = new eIDclient();
this.theClient.eventAdding += new AddClient(theClient_eventAdding);


Now in VB.NET (used eIDClient as Reference)
I try to do this.

Dim theClient As New eID()
 
Your syntax for adding the event in VB is wrong. VB doesn't use += for events, it uses AddHandler.

Try:

Addhandler me.theClient.eventAdding, addressof theClient_eventAdding
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top