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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Want to change C# to VB.Net

Want to change C# to VB.Net

Scheduled Pinned Locked Moved Visual Basic
csharphelp
4 Posts 2 Posters 1 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.
  • G Offline
    G Offline
    Golden Jing
    wrote on last edited by
    #1

    under code is C#, i would like all of you to show me how can to VB.net because i don't know C# at all and i don't know this code as well. Thanks for your help... public partial class frmMain : Form { public frmMain() { InitializeComponent(); allStands = new List[] { Stand1plates, Stand2plates, Stand3plates }; // Stand2plates.Add(3); } List[] allStands; List Stand1plates = new List(); List Stand2plates = new List(); List Stand3plates = new List();

    VB.Net

    T 1 Reply Last reply
    0
    • G Golden Jing

      under code is C#, i would like all of you to show me how can to VB.net because i don't know C# at all and i don't know this code as well. Thanks for your help... public partial class frmMain : Form { public frmMain() { InitializeComponent(); allStands = new List[] { Stand1plates, Stand2plates, Stand3plates }; // Stand2plates.Add(3); } List[] allStands; List Stand1plates = new List(); List Stand2plates = new List(); List Stand3plates = new List();

      VB.Net

      T Offline
      T Offline
      Tom Deketelaere
      wrote on last edited by
      #2

      If you had botherd to do a google search "c# to vb.net" the first link would have given you this: http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx[^] wich would give you:

      Public Partial Class frmMain
      Inherits Form
      Public Sub New()
      InitializeComponent()

              ' Stand2plates.Add(3); 
          allStands = New List() {Stand1plates, Stand2plates, Stand3plates} 
      End Sub 
      
      Private allStands As List() 
      Private Stand1plates As New List() 
      Private Stand2plates As New List() 
      Private Stand3plates As New List() 
      

      End Class

      G 1 Reply Last reply
      0
      • T Tom Deketelaere

        If you had botherd to do a google search "c# to vb.net" the first link would have given you this: http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx[^] wich would give you:

        Public Partial Class frmMain
        Inherits Form
        Public Sub New()
        InitializeComponent()

                ' Stand2plates.Add(3); 
            allStands = New List() {Stand1plates, Stand2plates, Stand3plates} 
        End Sub 
        
        Private allStands As List() 
        Private Stand1plates As New List() 
        Private Stand2plates As New List() 
        Private Stand3plates As New List() 
        

        End Class

        G Offline
        G Offline
        Golden Jing
        wrote on last edited by
        #3

        Thanks you for your help. I try to test this code but it have error on underline. What's problem ? Public Class Form1 Inherits Form Public Sub New() InitializeComponent() ' Stand2plates.Add(3); allStands = New List() {Stand1plates, Stand2plates, Stand3plates} End Sub Private allStands As List(Of Integer) Private Stand1plates As New List(Of Integer) Private Stand2plates As New List(Of Integer) Private Stand3plates As New List(Of Integer) Private Sub MoveFromTo(ByVal source As Integer, ByVal dest As Integer) Dim top As Integer = allStands(source - 1)(allStands(source - 1).Count - 1) allStands(source - 1).Remove(top) allStands(dest - 1).Add(top) RedrawPanels() End Sub End Sub

        VB.Net

        modified on Friday, August 22, 2008 10:43 PM

        T 1 Reply Last reply
        0
        • G Golden Jing

          Thanks you for your help. I try to test this code but it have error on underline. What's problem ? Public Class Form1 Inherits Form Public Sub New() InitializeComponent() ' Stand2plates.Add(3); allStands = New List() {Stand1plates, Stand2plates, Stand3plates} End Sub Private allStands As List(Of Integer) Private Stand1plates As New List(Of Integer) Private Stand2plates As New List(Of Integer) Private Stand3plates As New List(Of Integer) Private Sub MoveFromTo(ByVal source As Integer, ByVal dest As Integer) Dim top As Integer = allStands(source - 1)(allStands(source - 1).Count - 1) allStands(source - 1).Remove(top) allStands(dest - 1).Add(top) RedrawPanels() End Sub End Sub

          VB.Net

          modified on Friday, August 22, 2008 10:43 PM

          T Offline
          T Offline
          Tom Deketelaere
          wrote on last edited by
          #4

          put the "allStands = New List() {Stand1plates, Stand2plates, Stand3plates}" code in the form "load" or "shown" event and see if you still have the error without the error text I can't say much more

          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