Properti Shell.Parent
Mendapatkan objek yang mewakili induk objek saat ini.
Properti ini bersifat hanya baca.
Sintaks
objParent = Shell.Parent
Property Parent As Object
Nilai properti
Variabel jenis IDispatch yang menerima objek induk.
Contoh
Contoh berikut menunjukkan penggunaan Induk yang tepat untuk JScript, VBScript, dan Visual Basic.
Jscript:
<script language="JScript">
function fnShellParentJ()
{
var objShell = new ActiveXObject("shell.application");
var objParent;
objParent = objShell.Parent;
if (objParent != null)
{
alert("Got parent property");
}
}
</script>
Vbscript:
<script language="VBScript">
function fnShellParentVB()
dim objShell
set objShell = CreateObject("shell.application")
if (not objShell is nothing) then
dim objParent
set objParent = objShell.Parent
if (not objParent is nothing) then
alert("Got parent property")
end if
set objParent = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic:
Private Sub fnShellParentVB()
Dim objShell As Shell
Set objShell = New Shell
If (Not objShell Is Nothing) Then
Dim objParent As Object
Set objParent = objShell.Parent
If (Not objParent Is Nothing) Then
Debug.Print "Got parent object"
End If
Set objParent = Nothing
End If
Set objShell = Nothing
End Sub
Persyaratan
Persyaratan | Nilai |
---|---|
Klien minimum yang didukung |
Windows 2000 Professional, Windows XP [hanya aplikasi desktop] |
Server minimum yang didukung |
Windows 2000 Server [hanya aplikasi desktop] |
Header |
|
IDL |
|
DLL |
|