title: VB.Net passing/calling a variable
body: <p>How do I pass a value over to a module/function. Whenever I search here or Google I am getting code for C# rather than VB.net</p>
  
  <p>I want to be able to click on a button and pass a value to a module and action it. Each button has a value 1,2,3,4 etc... and they pass back to make a panel visible=true/false.</p>
  
  <p>i.e. I want to say the below but when I click btnShow1 I want to pass this as a value to a function and hide/show the panel I am talking about. </p>
  
  <p>Current code</p>
  
  <pre><code> Protected Sub btnShowQ1_Click(sender As Object, e As System.EventArgs) Handles btnShowQ1.Click
  
          If panel1.Visible = True Then
              panel1.Visible = False
          Else
              panel1.Visible = True
          End If
  
      End Sub
  </code></pre>
  
  <p>Guess code</p>
  
  <pre><code> 'Protected Sub btnShowQ1_Click(sender As Object, e As System.EventArgs) Handles btnShowQ1.Click
               vpanel = btnShowQ1.value
          Call fncPanel(vpanel as string) as string
  
      End Sub
  </code></pre>
  
  <p>Then somewhere - I guess in App_code I create function.vb</p>
  
  <pre><code>Imports Microsoft.VisualBasic
  
  Public Class ciFunctions
      Public Function fncPanel(vPanel as string)as string
              If (vPanel).visible = False then
                  (vPanel).visible = true
              Else
                  (vPanel).visible = false
               End IF 
      End Function
  End Class
  </code></pre>