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 给外婆敬酒祝福语简短