locked
How Convert C# Code In to VB.net RRS feed

  • Question

  • Hi,

    I given below some code that in C# :

     this.Loaded += new RoutedEventHandler(Window_Loaded);
                chatListBoxNames.SelectionChanged += new SelectionChangedEventHandler(chatListBoxNames_SelectionChanged);
                chatTxtBoxType.KeyDown +=new KeyEventHandler(chatTxtBoxType_KeyDown);
                chatTxtBoxType.KeyUp +=new KeyEventHandler(chatTxtBoxType_KeyUp);


      proxy.InnerDuplexChannel.Faulted += New EventHandler(AddressOf InnerDuplexChannel_Faulted)
                        proxy.InnerDuplexChannel.Opened += New EventHandler(AddressOf InnerDuplexChannel_Opened)
                        proxy.InnerDuplexChannel.Closed += New EventHandler(AddressOf InnerDuplexChannel_Closed)

    proxy.ConnectCompleted += New EventHandler(Of ConnectCompletedEventArgs)(AddressOf proxy_ConnectCompleted)

    proxy.SendFileCompleted += New EventHandler(Of SendFileCompletedEventArgs)(AddressOf proxy_SendFileCompleted)

    but i am not understanding that how to convert this into VB.NET Code 

    Please Let me know how to convert it?

    Regards

    Balram

    Saturday, December 8, 2012 12:35 PM

Answers

  • AddHandler Loaded, AddressOf Window_Loaded
    AddHandler chatListBoxNames.SelectionChanged, AddressOf chatListBoxNames_SelectionChanged
    AddHandler chatTxtBoxType.KeyDown, AddressOf chatTxtBoxType_KeyDown
    AddHandler chatTxtBoxType.KeyUp, AddressOf chatTxtBoxType_KeyUp



    Convert between VB, C#, C++, & Java (http://www.tangiblesoftwaresolutions.com)
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter


    • Edited by Dave Doknjas Saturday, December 8, 2012 3:15 PM
    • Proposed as answer by Pieter Geerkens Saturday, December 8, 2012 3:39 PM
    • Marked as answer by Balram Sharma Monday, December 10, 2012 11:16 AM
    Saturday, December 8, 2012 3:13 PM

All replies

  • Seriously! What is there to not understand? What effort have you made to even attempt converting this to VB?

    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    We are here to learn, to share knowledge, and to earn points; all in about equal measure.

    Saturday, December 8, 2012 12:59 PM
  • ILSPY will decompile to C# or VB so you could decompile the existing assembly to VB and copy and paste it. I'm pretty sure there will be some tidying up to do but it would give you a start.
    Saturday, December 8, 2012 1:06 PM
  • How much actually needs to be done to this code beyond removing the semicolons?

    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    We are here to learn, to share knowledge, and to earn points; all in about equal measure.

    Saturday, December 8, 2012 1:15 PM
  • AddHandler Loaded, AddressOf Window_Loaded
    AddHandler chatListBoxNames.SelectionChanged, AddressOf chatListBoxNames_SelectionChanged
    AddHandler chatTxtBoxType.KeyDown, AddressOf chatTxtBoxType_KeyDown
    AddHandler chatTxtBoxType.KeyUp, AddressOf chatTxtBoxType_KeyUp



    Convert between VB, C#, C++, & Java (http://www.tangiblesoftwaresolutions.com)
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter


    • Edited by Dave Doknjas Saturday, December 8, 2012 3:15 PM
    • Proposed as answer by Pieter Geerkens Saturday, December 8, 2012 3:39 PM
    • Marked as answer by Balram Sharma Monday, December 10, 2012 11:16 AM
    Saturday, December 8, 2012 3:13 PM
  • How much actually needs to be done to this code beyond removing the semicolons?


    Certainly more than that in this case.

    Convert between VB, C#, C++, & Java (http://www.tangiblesoftwaresolutions.com)
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

    Saturday, December 8, 2012 3:17 PM
  • Thank you, I stand corrected.

    It didn't occur to me that VB would have the plus-equals operator but not overload it the way C# did.


    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    We are here to learn, to share knowledge, and to earn points; all in about equal measure.

    Saturday, December 8, 2012 3:26 PM
  • Your friend http://www.developerfusion.com/tools/convert/csharp-to-vb/


    One good question is equivalent to ten best answers.

    Saturday, December 8, 2012 3:31 PM
  • Your friend http://www.developerfusion.com/tools/convert/csharp-to-vb/


    Did you try it for this case?

    Convert between VB, C#, C++, & Java (http://www.tangiblesoftwaresolutions.com)
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

    Saturday, December 8, 2012 3:35 PM
  • Hi,

    Pieter, convert  not a tuff task but some time you get such type of error that time my be confuse! but  i have tried but some error shows like Raise Event  .

    and next conversion you have write that remove only semicolons but remove semicolons not a answer.

    regards:

    Balram


    Monday, December 10, 2012 10:19 AM
  • Thanks Dave.

    Regards:

    Balram

    Monday, December 10, 2012 11:16 AM