Vb6 从用户控件内部检查自可见性
如何对用户控件的可见性进行自检Vb6 从用户控件内部检查自可见性,vb6,user-controls,visibility,Vb6,User Controls,Visibility,如何对用户控件的可见性进行自检 没有UserControl.visible或类似属性。您需要将UserControl强制转换为VBControlExtender Dim oVBControlExtender As VBControlExtender Set oVBControlExtender = UserControl.Extender If oVBControlExtender.Visible = True Then 'Code Here EndIf 这是非常基本的东西,而且根本不是“铸造
没有
UserControl.visible
或类似属性。您需要将UserControl强制转换为VBControlExtender
Dim oVBControlExtender As VBControlExtender
Set oVBControlExtender = UserControl.Extender
If oVBControlExtender.Visible = True Then
'Code Here
EndIf
这是非常基本的东西,而且根本不是“铸造”。您所做的只是获取对UserControl的Extender属性的强类型引用。通常也没有理由显式删除引用。这里正在进行的是一场货物崇拜。@xvan:Bob77的意思是,这是一种非常复杂的使用
Extender.Visible
本身的方法。简单方式和复杂方式都缺少错误处理,例如,当容器的站点可见性属性命名为IsVisible
时。