注册 登录
编程论坛 VB6论坛

动态添加SKIN皮肤控件报错

itpingtai 发布于 2023-10-20 11:05, 1024 次点击

Private WithEvents Command1 As CommandButton
Private WithEvents Skin1 As Skin

Set Command1 = Controls.Add(", "Command1")
Command1.Visible = True

Set Skin1 = Controls.Add("vb.Skin", "Skin1")    '这里报错,显示“无效的类串”(部件里已经添加了SKIN皮肤控件)

[此贴子已经被作者于2023-10-20 11:07编辑过]

3 回复
#2
yiyanxiyin2023-10-20 11:20
Controls.Add的第一个参数是: 控件注册成功后, 注册表中控件的ProgID值
#3
itpingtai2023-10-20 11:26
回复 2楼 yiyanxiyin
SKIN皮肤控件的参数值是什么呀,怎么查
#4
itpingtai2023-10-20 12:20
回复 2楼 yiyanxiyin
问题解决,谢谢你给的思路。

希望他人少走弯路,解决方法如下:

参数是:ActiveSkin4.Skin2

Set Skin1 = Controls.Add("ActiveSkin4.Skin2", "Skin1", Me)         '设置新增SKIN控件名称


1