社区
VB基础类
帖子详情
用代码添加控件?怎么写?
huhanshan013
2003-09-02 08:02:50
可以用代码实现
添加控件吗?
怎么写啊?
例如添加:
label1
怎么写?
...全文
241
6
打赏
收藏
用代码添加控件?怎么写?
可以用代码实现 添加控件吗? 怎么写啊? 例如添加: label1 怎么写?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
lihonggen0
2003-09-03
打赏
举报
回复
Dim WithEvents ctlLabel As VB.Label
Private Sub Form_Load()
Set ctlLabel = Controls.Add("VB.Label", "ctlLabel", Me)
'设置ctlLabel的位置和尺寸
ctlLabel.Top = 400 + 200
ctlLabel.Left = 20
'设置ctlLabel的标题
ctlLabel.Caption = "标题"
'使ctlLabel可见
ctlLabel.Visible = True
End Sub
lihonggen0
2003-09-03
打赏
举报
回复
Dim WithEvents ctlCommand As VB.CommandButton
Private Sub ctlCommand_Click()
MsgBox "click"
End Sub
Private Sub Form_Load()
Set ctlCommand = Controls.Add("VB.CommandButton", "ctlCommand1", Me)
'设置CommandButton的位置和尺寸
ctlCommand.Top = 400 + 200
ctlCommand.Left = 20
'设置CommandButton的标题
ctlCommand.Caption = "点击"
'使CommandButton可见
ctlCommand.Visible = True
End Sub
huhanshan013
2003-09-02
打赏
举报
回复
3楼的大哥,你的可以啊
但是看不懂前面三句的意思?
huhanshan013
2003-09-02
打赏
举报
回复
无效使用NEW关键字
不要NEW的话
对象变量或 with未设置
???
Dim aa As Label
With aa
aa.Caption = "sdfsdf"
aa.Left = 10
aa.Top = 21
End With
northwolves
2003-09-02
打赏
举报
回复
Private WithEvents label1 As Label
Private Sub Command1_Click()
If label1 Is Nothing Then Set label1 = Me.Controls.Add("vb.label", "label1", Me)
With label1
.Visible = True
.Caption = "label1"
.Left = 10
.Top = 10
End With
End Sub
txlicenhe
2003-09-02
打赏
举报
回复
dim label1 as new Label
With label1
.caption = "fafdsa"
.left = 10
.top = 10
...
End With
MSComm
控件
如果只安装VS2005,VS2008,使用MFC编程时,工具箱中无法
添加
串口通信
控件
。安装了这个组件后,就可以
添加
串口通信
控件
了。 1、将Mscomm.srg, Mscomm32.ocx,Mscomm32.dep三个文件复制到系统文件夹中,即C:\windows\system32 2、运行 注册.bat 3、导入 注册.reg
android 通过GridView
控件
获取本地图片并动态显示 程序源码
文章是参考博客http://blog.csdn.net/eastmount/article/details/41808179完成,主要讲述通过GridView
控件
点击加号图片动态
添加
本地相册图片,点击图片可以删除已
添加
图片。同时界面比较美观。 免费资源,希望对大家有所帮助。
C#用
代码
向窗体中
添加
控件
?
示例一:向窗体
添加
一个按钮:using System; using System.Drawing; using System.Windows.Forms; namespace Wind...
【MFC开发(3)】如何用
代码
操作一个
控件
?
【MFC开发(3)】如何用
代码
操作一个
控件
? ...
Qt入门之
代码
添加
控件
的方法
用
代码
添加
控件
的方法有两种
VB基础类
7,759
社区成员
197,606
社区内容
发帖
与我相关
我的任务
VB基础类
VB 基础类
复制链接
扫一扫
分享
社区描述
VB 基础类
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章