title: VB.net ByVal and ByRef doesnt work
body: <p>So i have a couple of subs and i want to share variables between them... I'm new to programming and i don't understand how to use ByVal and ByRef. I'm trying to make a login page.</p>
  
  <pre><code>Public Class Form1
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles LoginButton.Click (ByRef BlnCorrectPassword As Boolean, ByRef BlnCorrectLogin As Boolean)
  
  
      If blncorrectlogin = True And blncorrectpassword = True Then
          MsgBox("This part is still being developed!") ' I will make this form close and open a new form.
      Else
          MsgBox("The login or password is incorrect, please try again.")
      End If
  End Sub
  
  Private Sub Label1_Click(sender As Object, e As EventArgs)
  
  End Sub
  
  Private Sub Label1_Click_1(sender As Object, e As EventArgs) Handles Label1.Click
  
  End Sub
  
  Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
      Dim BlnCorrectLogin As Boolean
  
      If TextBox1.Text = "login" Then
          BlnCorrectLogin = True
  
      End If
  End Sub
  
  Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged
      Dim BlnCorrectPassword As Boolean
  
      If TextBox1.Text = "password" Then
          BlnCorrectPassword = True
  
      End If
     End Sub
   End Class
  </code></pre>