Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Can some body convert this c# code to VB.NET

Can some body convert this c# code to VB.NET

Scheduled Pinned Locked Moved ASP.NET
csharpdockerdata-structures
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NetBot
    wrote on last edited by
    #1

    public static Control AdvancedFindControl(this Control container, string controlId) { Queue controlQueue = new Queue(new[] { container }); Control currentControl; while (controlQueue.Count > 0) { currentControl = controlQueue.Dequeue(); foreach (Control child in currentControl.Controls) { controlQueue.Enqueue(child); } if (currentControl.ID == controlId) return currentControl; } return null; } thanks in adv

    E N D 3 Replies Last reply
    0
    • N NetBot

      public static Control AdvancedFindControl(this Control container, string controlId) { Queue controlQueue = new Queue(new[] { container }); Control currentControl; while (controlQueue.Count > 0) { currentControl = controlQueue.Dequeue(); foreach (Control child in currentControl.Controls) { controlQueue.Enqueue(child); } if (currentControl.ID == controlId) return currentControl; } return null; } thanks in adv

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      try this website, there are plenty more out there http://www.kamalpatel.net/ConvertCSharp2VB.aspx

      N 1 Reply Last reply
      0
      • E eyeseetee

        try this website, there are plenty more out there http://www.kamalpatel.net/ConvertCSharp2VB.aspx

        N Offline
        N Offline
        NetBot
        wrote on last edited by
        #3

        sorry but the foll line doesn`t seems to convert Dim controlQueue As Queue = New Queue(New(){container()})

        1 Reply Last reply
        0
        • N NetBot

          public static Control AdvancedFindControl(this Control container, string controlId) { Queue controlQueue = new Queue(new[] { container }); Control currentControl; while (controlQueue.Count > 0) { currentControl = controlQueue.Dequeue(); foreach (Control child in currentControl.Controls) { controlQueue.Enqueue(child); } if (currentControl.ID == controlId) return currentControl; } return null; } thanks in adv

          N Offline
          N Offline
          Neeraj Arora
          wrote on last edited by
          #4

          Public Shared Function AdvancedFindControl(ByVal Control As Me, ByVal controlId As String) As Control Dim controlQueue As Queue = New Queue(New() { container } ) Dim currentControl As Control While controlQueue.Count > 0 currentControl = controlQueue.Dequeue() Dim child As Control For Each child In currentControl.Controls controlQueue.Enqueue(child) Next If currentControl.ID = controlId Then Return currentControl End If End While Return Nothing End Function

          1 Reply Last reply
          0
          • N NetBot

            public static Control AdvancedFindControl(this Control container, string controlId) { Queue controlQueue = new Queue(new[] { container }); Control currentControl; while (controlQueue.Count > 0) { currentControl = controlQueue.Dequeue(); foreach (Control child in currentControl.Controls) { controlQueue.Enqueue(child); } if (currentControl.ID == controlId) return currentControl; } return null; } thanks in adv

            D Offline
            D Offline
            Dave Doknjas
            wrote on last edited by
            #5

            This is not valid C# code - you're missing a type name after 'new': ...new Queue(new[] { container }); I would expect something like: ...new Queue(new Foo[] { container });

            David Anton http://www.tangiblesoftwaresolutions.com C++ to C# Converter C++ to VB Converter C++ to Java Converter Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: convert VB, C#, or Java to C++/CLI Java to VB & C# Converter: convert Java to VB or C#

            D 1 Reply Last reply
            0
            • D Dave Doknjas

              This is not valid C# code - you're missing a type name after 'new': ...new Queue(new[] { container }); I would expect something like: ...new Queue(new Foo[] { container });

              David Anton http://www.tangiblesoftwaresolutions.com C++ to C# Converter C++ to VB Converter C++ to Java Converter Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: convert VB, C#, or Java to C++/CLI Java to VB & C# Converter: convert Java to VB or C#

              D Offline
              D Offline
              Dave Doknjas
              wrote on last edited by
              #6

              Whoa ... posted too soon - this is valid C# syntax - I'm working on the VB equivalent - stay tuned.

              David Anton http://www.tangiblesoftwaresolutions.com C++ to C# Converter C++ to VB Converter C++ to Java Converter Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: convert VB, C#, or Java to C++/CLI Java to VB & C# Converter: convert Java to VB or C#

              D 1 Reply Last reply
              0
              • D Dave Doknjas

                Whoa ... posted too soon - this is valid C# syntax - I'm working on the VB equivalent - stay tuned.

                David Anton http://www.tangiblesoftwaresolutions.com C++ to C# Converter C++ to VB Converter C++ to Java Converter Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: convert VB, C#, or Java to C++/CLI Java to VB & C# Converter: convert Java to VB or C#

                D Offline
                D Offline
                Dave Doknjas
                wrote on last edited by
                #7

                Apparently, there is no VB equivalent to an inferred array initialization (e.g., "new[] {...}" in C#3) The following was produced with Instant VB, with one manual adjustment - adding "Control" after the 'New': _ Public Shared Function AdvancedFindControl(ByVal container As Control, ByVal controlId As String) As Control Dim controlQueue As New Queue(New Control() { container }) Dim currentControl As Control Do While controlQueue.Count > 0 currentControl = controlQueue.Dequeue() For Each child As Control In currentControl.Controls controlQueue.Enqueue(child) Next child If currentControl.ID = controlId Then Return currentControl End If Loop Return Nothing End Function David Anton http://www.tangiblesoftwaresolutions.com C++ to C# Converter C++ to VB Converter C++ to Java Converter Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: convert VB, C#, or Java to C++/CLI Java to VB & C# Converter: convert Java to VB or C#

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups