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热门推荐
6 保研的祝福语简短
10 年轻20岁祝福语简短
11 朋友结婚祝福语信息简短
12 女孩婚礼贺卡祝福语简短
13 30段点歌简短祝福语
14 虎年春节祝福语图文简短
15 写给后妈祝福语大全简短
16 简短回复生日祝福语
17 校长送毕业祝福语简短
18 毕业立体贺卡祝福语简短