I actually can't believe I wasn't able to find an answer to something like this.
Public NotInheritable Class Tester
Public Shared Sub changeText(ByVal TextBoxControl As Windows.Forms.TextBoxBase)
Dim testString As String = TextBoxControl.Text
testString = "Changed!"
End Sub
End Class
I'd expect testString
to be a pointer to TextBoxControl.Text
. However, TextBoxControl.Text
is not changed. Instead, it appears
Dim testString As String = TextBoxControl.Text
is equivalent to
Dim testString As String = TextBoxControl.Text.Clone()
but I don't want that behavior. I just want a reference to TextBoxControl
's Text
property. Can I do this? Why isn't the string passed by reference?