拖动1文本框和1按钮
双击按钮1,您将被转到 Button1_Click event
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click End Sub End Class
输入您要定位的对象的名称,在本例中为textbox1。.Text是要在文本上添加文字的属性。
Property Textbox.Text, gets or sets the current text in the TextBox。现在,我们有Textbox1.Text
我们需要设置它的值,Textbox1.Text所以我们将使用=符号。我们要输入的值Textbox1.Text是Hello World。总体而言,这是为Hello World赋予值的总代码Textbox1.Text
TextBox1.Text = "Hello World"
将该代码添加到的clicked event中button1
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click TextBox1.Text = "Hello World" End Sub End Class