VB.NET如何用代码的方式添加按钮 50
1个回答
展开全部
Friend WithEvents Button1 As New System.Windows.Forms.Button //这一行很重要
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Controls.Add(Button1)
Button1.Location = New System.Drawing.Point(76, 186)
Button1.Name = "Button1"
Button1.Size = New System.Drawing.Size(75, 23)
Button1.TabIndex = 2
Button1.Text = "Button1"
Button1.UseVisualStyleBackColor = True
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Text = "Hello,World!"
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询