"工具箱"中单击右键,选择"选择项"菜单,打开"选择工具箱项"窗口,选择"
COM组件
"标签,在列表中找到并勾选"Windows
Media
Player"组件,单击"确定"按钮.将该组件添加到指定的工具箱
选项卡
中,然后在工具箱里面找
Windows
Player
控件,拉到form里面,拉出来的控件就是AxWindowsMediaPlayer
Private WithEvents NewTextBox As TextBox
'通过使用WithEvents关键字声明一个对象变量为新的命令按钮
Private Sub Command1_Click()
If NewTextBox Is Nothing Then
Set NewTextBox = Controls.Add("VB.TextBox", "cmdNew", Form1)
NewTextBox.Visible = True
End If
End Sub
Exit Sub
Else
Controls.Remove NewTextBox
Set NewTextBox = Nothing
Dim?Bt?as?New?Button
Bt.Size=New?Size(100,100)
Bt.Location=New?Point(100,100)
Bt.Text="New?Button"
Me.Controls.Add(Bt)
步骤如下:
以上就是土嘎嘎小编为大家整理的在VB.NET中添加控件相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!