dim txt as controlset txt=controls.add("vb.textbox","txtName")
txt.visible=true
txt.visible=true
解决方案 »
- 用SendMessage发送消息
- 求助 VB 读取数据问题
- MDI窗体的子窗体的大小及位置的调整?
- 通过工程--加载的控件 很多都不明白他的属性怎么用MSDN好象也没有
- 最后30了 大家帮下忙咯 关于用sub 或者 function来返回一个数组
- 为什么我得VB程序进行窗体切换时,有时会出现错误,导致程序退出?
- VB 和 JAVA
- 和硬件接口!!!!!!!!
- 如何在桌面出现之前运行我的电脑保护程序。
- 怎样让程序启动时自动运行?---------------------急!!!!!!!!!!!!!1
- 一个百思不得其解的怪问题:为什么用Addnew方法增加记录,用cancelupdate取消后,记录仍然加到数据库里了?
- 问题:为什么我的机器有时候在运行长时间后关机,再重起,分辨率却自动降低?
1.Load txt(n)
Unload txt(n)2.Me.controls.add
Control.remove "control Name"两个是匹配使用的
load 的不能removeadd的,不能 unload
Option Explicit
Private WithEvents NewButton As CommandButton
Private WithEvents NewOption As OptionButton
Private Sub Command1_Click()
If NewOption Is Nothing Then
Set NewOption = _
Controls.Add("VB.OptionButton", _
"Option", Me)
NewOption.Move 3000, 1000, 1000, 300
NewOption.Caption = "New Option"
NewOption.Visible = True
End If
If NewButton Is Nothing Then
Set NewButton = _
Controls.Add("VB.CommandButton", _
"cmdNew", Me)
NewButton.Move _
Command1.Left + Command1.Width + 240, _
Command1.Top
NewButton.Caption = "New Button"
NewButton.Visible = True
End If
End Sub
Private Sub NewButton_Click()
MsgBox "New button clicked"
End SubPrivate Sub NewOption_Click()
MsgBox "New option clicked"
End Sub