Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb6 从用户控件内部检查自可见性_Vb6_User Controls_Visibility - Fatal编程技术网

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
时。