title: Putting the value of a variable from class to the variable of my form
body: <p>I have a class names <code>intersection_regular_island</code> and I created a new instance of it in <code>form1</code>. I wanted to re-declare a certain variable in that class so I tried this code</p>
  
  <pre><code>Public Class form1
     Dim a As New intersection_regular_island
     Dim penToUse As Pen = a.leftA_pen
  
     Sub sampleSub()
        penToUse = New Pen(Color.Green, a.arrowWidth)
     End Sub
  End Class
  </code></pre>
  
  <p>Whereas if I do it like this, it is working</p>
  
  <pre><code>Public Class form1
     Dim a As New intersection_regular_island
     Sub sampleSub()
        a.leftA_pen = New Pen(Color.Green, a.arrowWidth)
     End Sub
  End Class
  </code></pre>
  
  <p>Note that it is just a small part of the code, it's not the actual code. It is for illustration purposes so maybe I might missed something.</p>
  
  <p>Seems like I'm missing something that is so simple?</p>
  
  <p>Edit:</p>
  
  <p>I want to do it like that so I can easily perform a <code>select case</code></p>
  
  <p>So instead of copying and pasting this code many times</p>
  
  <pre><code>Select Case lightFunctionNum
              Case 1
                  a.leftA_pen = New Pen(Color.Green, a.arrowWidth)
              Case 2
                  a.leftA_pen = New Pen(Color.Yellow, a.arrowWidth)
              Case 3
                  a.leftA_pen = New Pen(Color.Red, a.arrowWidth)
              Case 4
                  Dim blinkColorTrue As Color = Color.Green
                  Dim blinkColorFalse As Color = Color.Transparent
                  If blinkBoolean_A = False Then a.leftA_pen = New Pen(blinkColorFalse, a.arrowWidth) : blinkBoolean_A = True Else a.leftA_pen = New Pen(blinkColorTrue, a.arrowWidth) : blinkBoolean_A = False
              Case 5
                  Dim blinkColorTrue As Color = Color.Yellow
                  Dim blinkColorFalse As Color = Color.Transparent
                  If blinkBoolean_A = False Then a.leftA_pen = New Pen(blinkColorFalse, a.arrowWidth) : blinkBoolean_A = True Else a.leftA_pen = New Pen(blinkColorTrue, a.arrowWidth) : blinkBoolean_A = False
              Case Else
                  a.leftA_pen = New Pen(Color.Transparent, a.arrowWidth)
  End Select
  </code></pre>
  
  <p>I wanted it become like this</p>
  
  <pre><code>Select Case arrowAndPosition
              Case arrowAndPositionChoices.A_Left
                  penToUse = a.leftA_pen
              Case arrowAndPositionChoices.B_Left
                  penToUse = a.leftB_pen
              Case arrowAndPositionChoices.C_Left
                  penToUse = a.leftC_pen
              Case arrowAndPositionChoices.D_Left
                  penToUse = a.leftD_pen
  End Select
  
  Select Case lightFunctionNum
          Case 1
              penToUse = New Pen(Color.Green, a.arrowWidth)
              Console.WriteLine("Trigger")
          Case 2
              penToUse = New Pen(Color.Yellow, a.arrowWidth)
          Case 3
              penToUse = New Pen(Color.Red, a.arrowWidth)
          Case 4
              Dim blinkColorTrue As Color = Color.Green
              Dim blinkColorFalse As Color = Color.Transparent
              If blinkBoolean = False Then penToUse = New Pen(blinkColorFalse, a.arrowWidth) : blinkBoolean = True Else penToUse = New Pen(blinkColorTrue, a.arrowWidth) : blinkBoolean = False
          Case 5
              Dim blinkColorTrue As Color = Color.Yellow
              Dim blinkColorFalse As Color = Color.Transparent
              If blinkBoolean = False Then penToUse = New Pen(blinkColorFalse, a.arrowWidth) : blinkBoolean = True Else penToUse = New Pen(blinkColorTrue, a.arrowWidth) : blinkBoolean = False
          Case Else
              penToUse = New Pen(Color.Transparent, a.arrowWidth)
  
  End Select
  </code></pre>