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. Variables..

Variables..

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
3 Posts 3 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.
  • S Offline
    S Offline
    Subjugate
    wrote on last edited by
    #1

    Does anyone knows how to share the value of a particular variable but are declared in different class?

    R J 2 Replies Last reply
    0
    • S Subjugate

      Does anyone knows how to share the value of a particular variable but are declared in different class?

      R Offline
      R Offline
      Rupesh Kumar Swami
      wrote on last edited by
      #2

      declare the variable as shered variable so it can be accessed and modified. For example Public Class Utility Public Shared SharedVariable As Integer End Class hope this helps

      Rupesh Kumar Swami Software Developer, Integrated Solution, Bikaner (India) My Company Award: Best VB.NET article of June 2008: Create Column Charts Using OWC11

      1 Reply Last reply
      0
      • S Subjugate

        Does anyone knows how to share the value of a particular variable but are declared in different class?

        J Offline
        J Offline
        Jon_Boy
        wrote on last edited by
        #3

        Use a property

        Dim strVar As String = "la la la"
        
        Public Property SharedMyVariableWithTheWorld() As String
            Get
                Return strVar
            End Get
            Set(ByVal value As String)
                strVar = value
            End Set
        End Property
        

        Any suggestions, ideas, or 'constructive criticism' are always welcome.

        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