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. General Programming
  3. C#
  4. I need help please

I need help please

Scheduled Pinned Locked Moved C#
csharphelp
6 Posts 5 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.
  • T Offline
    T Offline
    TheCardinal
    wrote on last edited by
    #1

    Can somebody translate this vb.net code to its c# equivalent. :) Public Class ColorRange Private _high As Color = Nothing Private _low As Color = Nothing Public Property Low() As Color Get Return _low End Get Set(ByVal Value As Color) _low = Value End Set End Property Public Property High() As Color Get Return _high End Get Set(ByVal Value As Color) _high = Value End Set End Property Public Sub New() End Sub Public Sub New(ByVal low As Color, ByVal high As Color) _low = low _high = high End Sub Public Shadows Function ToString() As String Return String.Format("{0}, {1}", _low, _high) End Function End Class

    C S K 3 Replies Last reply
    0
    • T TheCardinal

      Can somebody translate this vb.net code to its c# equivalent. :) Public Class ColorRange Private _high As Color = Nothing Private _low As Color = Nothing Public Property Low() As Color Get Return _low End Get Set(ByVal Value As Color) _low = Value End Set End Property Public Property High() As Color Get Return _high End Get Set(ByVal Value As Color) _high = Value End Set End Property Public Sub New() End Sub Public Sub New(ByVal low As Color, ByVal high As Color) _low = low _high = high End Sub Public Shadows Function ToString() As String Return String.Format("{0}, {1}", _low, _high) End Function End Class

      C Offline
      C Offline
      Coding C
      wrote on last edited by
      #2

      Hi, check this link. its really usefull. http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx[^] Hope This Works For You. Nitin...

      D 1 Reply Last reply
      0
      • T TheCardinal

        Can somebody translate this vb.net code to its c# equivalent. :) Public Class ColorRange Private _high As Color = Nothing Private _low As Color = Nothing Public Property Low() As Color Get Return _low End Get Set(ByVal Value As Color) _low = Value End Set End Property Public Property High() As Color Get Return _high End Get Set(ByVal Value As Color) _high = Value End Set End Property Public Sub New() End Sub Public Sub New(ByVal low As Color, ByVal high As Color) _low = low _high = high End Sub Public Shadows Function ToString() As String Return String.Format("{0}, {1}", _low, _high) End Function End Class

        S Offline
        S Offline
        Stefan Troschuetz
        wrote on last edited by
        #3

        I've never worked with VB.NET but after a quick glance at the code I think I could easily translate this within a few minutes. So why don't you feel able to do this? Don't be that lazy!


        "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

        www.troschuetz.de

        1 Reply Last reply
        0
        • T TheCardinal

          Can somebody translate this vb.net code to its c# equivalent. :) Public Class ColorRange Private _high As Color = Nothing Private _low As Color = Nothing Public Property Low() As Color Get Return _low End Get Set(ByVal Value As Color) _low = Value End Set End Property Public Property High() As Color Get Return _high End Get Set(ByVal Value As Color) _high = Value End Set End Property Public Sub New() End Sub Public Sub New(ByVal low As Color, ByVal high As Color) _low = low _high = high End Sub Public Shadows Function ToString() As String Return String.Format("{0}, {1}", _low, _high) End Function End Class

          K Offline
          K Offline
          kkadir
          wrote on last edited by
          #4

          public class ColorRange { private Color _high = Color.Empty; private Color _low = Color.Empty; public Color Low { get { return low; } set { _low = value; } } public Color High { get { return high; } set { _high = value; } } public void New() { // } public void New(Color low, Color high) { _low = low; _high = high; } public override string ToString() { return String.Formt("{0},{1}",_low,_high); } } By the way I don't even know VB but figured the C# code out easily. So you could do it. Don't be lazy and give a try next time ;)

          .:: Something is Wrong ::.

          T 1 Reply Last reply
          0
          • C Coding C

            Hi, check this link. its really usefull. http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx[^] Hope This Works For You. Nitin...

            D Offline
            D Offline
            Daniel Grunwald
            wrote on last edited by
            #5

            That converter is based on a several years old version of the SharpDevelop converter. It doesn't even preserve comments when converting. The new version of the SharpDevelop converter is at http://developer.sharpdevelop.net/codeconvert.net/Convert.aspx[^]

            1 Reply Last reply
            0
            • K kkadir

              public class ColorRange { private Color _high = Color.Empty; private Color _low = Color.Empty; public Color Low { get { return low; } set { _low = value; } } public Color High { get { return high; } set { _high = value; } } public void New() { // } public void New(Color low, Color high) { _low = low; _high = high; } public override string ToString() { return String.Formt("{0},{1}",_low,_high); } } By the way I don't even know VB but figured the C# code out easily. So you could do it. Don't be lazy and give a try next time ;)

              .:: Something is Wrong ::.

              T Offline
              T Offline
              TheCardinal
              wrote on last edited by
              #6

              thanks guys. I just started using c# from vb6. I have tried to convert it already. i just want to double check it if what i have done was right :) thanks :)

              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