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. Visual Basic
  4. Little VB .NET Syntax Problem!!

Little VB .NET Syntax Problem!!

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorial
6 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.
  • F Offline
    F Offline
    fadee
    wrote on last edited by
    #1

    Hi How to make property indexers in VB .NET... Against my will, I am standing beside my own shadow! :(( ------------------- Therez No Place like ... 127.0.0.1

    D 1 Reply Last reply
    0
    • F fadee

      Hi How to make property indexers in VB .NET... Against my will, I am standing beside my own shadow! :(( ------------------- Therez No Place like ... 127.0.0.1

      D Offline
      D Offline
      Dan Morris
      wrote on last edited by
      #2

      The following should work: Public Property Notes(ByVal index As Integer) As String   Get     Return m_Notes(index)   End Get   Set(ByVal Value As String)     m_Notes(index) = Value   End Set End Property The when you're using the property: myClass.Notes(2) = "Some message!" Hope this helps. Dan Morris

      F L 2 Replies Last reply
      0
      • D Dan Morris

        The following should work: Public Property Notes(ByVal index As Integer) As String   Get     Return m_Notes(index)   End Get   Set(ByVal Value As String)     m_Notes(index) = Value   End Set End Property The when you're using the property: myClass.Notes(2) = "Some message!" Hope this helps. Dan Morris

        F Offline
        F Offline
        fadee
        wrote on last edited by
        #3

        he he he he.... I want to do myClass(2) = "Some message!" :) Anyway, thanks for your time... I appreciate it :) fadee ------------------- Therez No Place like ... 127.0.0.1

        M 1 Reply Last reply
        0
        • F fadee

          he he he he.... I want to do myClass(2) = "Some message!" :) Anyway, thanks for your time... I appreciate it :) fadee ------------------- Therez No Place like ... 127.0.0.1

          M Offline
          M Offline
          Mike Ellison
          wrote on last edited by
          #4

          I think you want to assign a property as Default. Try this page on MSDN[^].

          F 1 Reply Last reply
          0
          • M Mike Ellison

            I think you want to assign a property as Default. Try this page on MSDN[^].

            F Offline
            F Offline
            fadee
            wrote on last edited by
            #5

            Meeeeeeeerci :rose::rose::rose::rose::rose::rose::rose: ------------------- Therez No Place like ... 127.0.0.1

            1 Reply Last reply
            0
            • D Dan Morris

              The following should work: Public Property Notes(ByVal index As Integer) As String   Get     Return m_Notes(index)   End Get   Set(ByVal Value As String)     m_Notes(index) = Value   End Set End Property The when you're using the property: myClass.Notes(2) = "Some message!" Hope this helps. Dan Morris

              L Offline
              L Offline
              Lewis Moten
              wrote on last edited by
              #6

              Add a "Default" to that property and then you can call it as myClass(2) = "SomeMessage". Default Public Property Notes(ByVal index As Integer) As String Get Return m_Notes(index) End Get Set(ByVal Value As String) m_Notes(index) = Value End Set End Property

              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