Click here to Skip to main content
16,019,152 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
I Need these lines converted to vb.net , any help will be appreciated :

C#
CommSetting.comm.PhoneConnected -= new EventHandler(comm_PhoneConnected);
CommSetting.comm.MessageReceived -= new MessageReceivedEventHandler(comm_MessageReceived);
Posted

Remove the semi-colons.

There are free on-line converter tools available - e.g. Telerik[^] (amongst others)

VB
CommSetting.comm.PhoneConnected -= New EventHandler(comm_PhoneConnected)
CommSetting.comm.MessageReceived -= New MessageReceivedEventHandler(comm_MessageReceived)

'=======================================================
'Service provided by Telerik (www.telerik.com)
'Conversion powered by NRefactory.
'Twitter: @telerik
'Facebook: facebook.com/telerik
'=======================================================


A list of other converters[^]

Edit - Comments about the converters still apply, but this is why SA's solution 2 is highly relevant.

To remove a handler:
VB
RemoveHandler CommSetting.comm.PhoneConnected, AddressOf comm_PhoneConnected
RemoveHandler CommSetting.comm.MessageReceived, AddressOf comm_MessageReceived
 
Share this answer
 
v3
Comments
besthms 10-Jun-15 4:28am    
it not working like this :( , it will be different structure for this .
CHill60 10-Jun-15 4:58am    
I've updated my solution
This is not "convert"; this is translation from one language to another. You can translate any code automatically, using online tools, or, better yet, translate the whole assembly with the guarantee and good quality off-line, using open-source ILSpy. Please see my past answer: Code Interpretation, C# to VB.NET[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900