正在做一场噩梦,试图想出一个标题来继续我的问题。
无论如何,我的问题很简单,这样做是否更好:
Private TxtbxUserName As New TextBox With {.Text= "XXXX"}
Private Sub DoSomething(ByVal TextBoxText as string)
Dim Text as String = TextBoxText
End Sub
或这样做?:
Private TxtbxUserName As New TextBox With {.Text = "XXXX"}
Private Sub DoSomething()
Dim Text as String = TxtbxUserName.text
End Sub
每种方法的具体优势是什么?