rekam
Freshman
Hello, I have a little problem of understanding with ByRef and ByVal. Look at this code :
If passed with ByVal, after the call, the text should be "before" ?? Because it's not the reference which is passed....
Can someone explains me what's happening ?? Thanks !
Visual Basic:
Private Sub test( )
Me.TextBox1.Text = "before"
'(1) Show textBox1 content
MsgBox(Me.TextBox1.Text)
'(2) Call method
Me.rere(Me.TextBox1)
'(3) Show textBox1 content after the call
MsgBox(Me.TextBox1.Text)
End Sub
Private Sub rere(ByVal t As System.Windows.Forms.TextBox)
t.Text = "after"
End Sub
If passed with ByVal, after the call, the text should be "before" ?? Because it's not the reference which is passed....
Can someone explains me what's happening ?? Thanks !