單擊按鈕時文字框上的 Hello World

拖動 1 個文字框和 1 個按鈕

http://i.stack.imgur.com/sgFeW.jpg

雙擊按鈕 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"

將該程式碼新增到 button1clicked event

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox1.Text = "Hello World"
    End Sub
End Class

http://i.stack.imgur.com/axKMb.jpg