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. problem when change C# to VB.Net

problem when change C# to VB.Net

Scheduled Pinned Locked Moved Visual Basic
helpcsharpquestion
3 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 is some code of 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(); private void MoveFromTo(int source, int dest) { int top = allStands[source-1][allStands[source-1].Count - 1]; allStands[source - 1].Remove(top); allStands[dest-1].Add(top); RedrawPanels(); } ================================= I change it to VB.net as bellow: 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 but it has error where underline. what's problem ? How do i change it ?

    VB.Net

    P 1 Reply Last reply
    0
    • G Golden Jing

      Under is some code of 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(); private void MoveFromTo(int source, int dest) { int top = allStands[source-1][allStands[source-1].Count - 1]; allStands[source - 1].Remove(top); allStands[dest-1].Add(top); RedrawPanels(); } ================================= I change it to VB.net as bellow: 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 but it has error where underline. what's problem ? How do i change it ?

      VB.Net

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Sovann wrote:

      error where underline

      What underline?

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

      G 1 Reply Last reply
      0
      • P Paul Conrad

        Sovann wrote:

        error where underline

        What underline?

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

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

        sorry it's not show the underline i put tag but it not show. 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(); private void MoveFromTo(int source, int dest) { int top = allStands[source-1][allStands[source-1].Count - 1]; allStands[source - 1].Remove(top); allStands[dest-1].Add(top); RedrawPanels(); } ================================= I change it to VB.net as bellow: 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

        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