Results 1 to 9 of 9

Thread: C# to vb.net equivalents

  1. #1
    Senior Member kasavien's Avatar
    Join Date
    Aug 2005
    Location
    St. Albans
    Posts
    1,829
    Thanks
    145
    Thanked
    104 times in 49 posts

    C# to vb.net equivalents

    Hi All

    Does anyone know what the equivalent of this c# constructor is in vb? I don't have a choice about using vb

    Code:
    public ClassConstructor() 
        : this(true)
    {   }
    
    public ClassConstructor(bool something)
    {
        /* do something with something */
    }
    Thanks

    Andy

  2. #2
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable

    Re: C# to vb.net equivalents

    This should help: http://msdn.microsoft.com/en-us/library/ms973896.aspx

    And many sympathies about being forced to use VB.
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  3. Received thanks from:

    kasavien (14-01-2011)

  4. #3
    Senior Member kasavien's Avatar
    Join Date
    Aug 2005
    Location
    St. Albans
    Posts
    1,829
    Thanks
    145
    Thanked
    104 times in 49 posts

    Re: C# to vb.net equivalents

    it's like reading a really bad book

  5. #4
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: C# to vb.net equivalents

    this might sound evil, but I've found in those situations, using reflector simple flick between c# and vb.net very useful
    throw new ArgumentException (String, String, Exception)

  6. #5
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,230
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: C# to vb.net equivalents

    I take it you've got this sorted now?

  7. #6
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: C# to vb.net equivalents

    Its been a while since i've touched vb.net, but it will be somthing like...

    Code:
    Sub New(ByVal something as Boolean)
    EndSub
    
    Sub New
        Me.New(true)
    End Sub
    I'm sure a quick Google for 'vb.net constructor overloading' will yield a wealth of results though.
    To err is human. To really foul things up ... you need a computer.

  8. #7
    Senior Member
    Join Date
    May 2009
    Location
    Norfolk
    Posts
    474
    Thanks
    3
    Thanked
    26 times in 26 posts
    • pipTheGeek's system
      • Motherboard:
      • Asus P6T Deluxe
      • CPU:
      • Core i7 920 @ 3.6GHz
      • Memory:
      • 3 * 2Gb Corsair XMS @ DDR3 1800
      • Storage:
      • 300GB 15K SAS + 500Gb
      • Graphics card(s):
      • GTX570
      • PSU:
      • corsair 760i
      • Case:
      • Corsair 550d
      • Operating System:
      • Windows 7
      • Monitor(s):
      • Dell Alienware 23"
      • Internet:
      • VM 50Mb

    Re: C# to vb.net equivalents

    @yamangman - that looks right.
    @TheAnimus - Reflector rocks. Was using it only today.

    @Everyone taking the mick out of VB

    PS. I'm a VB .NET programmer and i like VB.

  9. #8
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable

    Re: C# to vb.net equivalents

    Quote Originally Posted by pipTheGeek View Post
    PS. I'm a VB .NET programmer and i like VB.


    That surely must qualify as a mental disorder.

    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  10. #9
    Senior Member kasavien's Avatar
    Join Date
    Aug 2005
    Location
    St. Albans
    Posts
    1,829
    Thanks
    145
    Thanked
    104 times in 49 posts

    Re: C# to vb.net equivalents

    I did get this sorted although only just seen this thread again

    I don't mind vb so much now, i think i've gotten used to it and its nuances now. I'd always prefer c# though.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. vb.net check if record exists in dataset
    By icanhazburger in forum Software
    Replies: 3
    Last Post: 25-10-2011, 09:30 AM
  2. Any hints and tips on vb.net interviews ?
    By Pazza in forum General Discussion
    Replies: 8
    Last Post: 30-11-2010, 10:51 PM
  3. VB.Net help
    By handscombmp in forum Software
    Replies: 3
    Last Post: 10-07-2010, 02:27 PM
  4. VB.NET Help
    By h4x3r920 in forum Help! Quick Relief From Tech Headaches
    Replies: 0
    Last Post: 06-05-2007, 05:14 PM
  5. VB.NET If Statement
    By Matt1eD in forum Software
    Replies: 3
    Last Post: 03-09-2005, 11:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •