Visual Basic .NET单击按钮后,文本框中的Hello World
示例
拖动1文本框和1按钮
双击按钮1,您将被转到Button1_Clickevent
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
End Sub
End Class输入您要定位的对象的名称,在本例中为textbox1。.Text是要在文本上添加文字的属性。
PropertyTextbox.Text,getsorsetsthecurrenttextintheTextBox。现在,我们有Textbox1.Text
我们需要设置它的值,Textbox1.Text所以我们将使用=符号。我们要输入的值Textbox1.Text是HelloWorld。总体而言,这是为HelloWorld赋予值的总代码Textbox1.Text
TextBox1.Text = "Hello World"
将该代码添加到的clickedevent中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热门推荐
10 小红书平安祝福语简短
11 生日祝福语大全女孩简短
12 收生日红包祝福语 简短
13 领证幽默祝福语简短
14 法考面试祝福语简短
15 老哥出门祝福语简短语
16 送灯祝福语简短独特
17 幼儿狗年祝福语大全简短
18 好听的元旦简短祝福语