迷茫......

panda_lees 2001-12-13 04:57:06
在FORM中怎样动态创建一个LABEL控件?
...全文
70 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
panda_lees 2001-12-14
  • 打赏
  • 举报
回复
在窗体上画一个Label控件,它的Index属性值设为0,名字为:lblArray
Private Sub Form_Load()
lblArray(0).Caption = "11111"
Load lblArray(1)
lblArray(1).visible=true
lblArray(1).Caption = "dddd"
End Sub


OK.......
panda_lees 2001-12-14
  • 打赏
  • 举报
回复
foolishtiger:
在窗体上画一个Label控件,它的Index属性值设为0,名字为:lblArray
Private Sub Form_Load()
lblArray(0).Caption = "11111"
Load lblArray(1)
lblArray(1).Caption = "dddd"
End Sub
可还是要报错。。。
:(
foolishtiger 2001-12-13
  • 打赏
  • 举报
回复
在窗体上画一个Label控件,然后把它的Index属性值设为0,就是控件数组了,就可以用sonicdater(发呆呆)的方法了.
panda_lees 2001-12-13
  • 打赏
  • 举报
回复
请问:怎样创建label控件数组
在MSDN上没找到. :(
sonicdater 2001-12-13
  • 打赏
  • 举报
回复
先 建了 label控件 数组。
如 Name : lblArray(0)

加载时: Load lblArray(1)
lblArray(1).Caption = "Ok! I am the 2nd Label"
不用时:Unload lblArray(1)
hhbll_2001 2001-12-13
  • 打赏
  • 举报
回复
Private WithEvents newlabel As Label

Private Sub Command1_Click()
If newlabel Is Nothing Then
Set newlabel = Controls.Add("vb.label", "lblnew", Me)
newlabel.Move Form1.Left + 500, 500
newlabel.Caption = "New Lable"
newlabel.Visible = True
Else
MsgBox "New Lable"
End If
End Sub

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧