如何在Internet Explorer 9中使用VB6隐藏地址栏

如何在Internet Explorer 9中使用VB6隐藏地址栏

问题描述:

大家好, InternetExplorer.AddressBar = False 与IE 8正常运行。但在IE 9中,这不起作用。地址栏可见。请帮忙。



代码:



Hi All, InternetExplorer.AddressBar = False was working fine with IE 8. But in IE 9, this does not work. Address Bar is visible. Please help.

Code:

Dim sctest As ScriptControl 
Dim scode As String 
scode = " function OnProgramLoad() { window.open(""" & "http://www.google.co.uk/" & """, """ & "mywindow" & """); } " 
If Len(scode) < 1 Then Exit Sub 
If InStr(1, scode, "OnProgramLoad", vbTextCompare) = 0 Then Exit Sub 
Set sctest = New ScriptControl 
With sctest 
    .Language = "JScript" 
    .AllowUI = True 
    .AddObject "Application", App 
    .AddObject "Clipboard", Clipboard 
    .AddObject "Printer", Printer 
    .AddObject "Screen", Screen 
    .AddCode scode 
    .Run "OnProgramLoad" 'Error is thrown here
End With 
Set sctest = Nothing







已添加从我的解决方案下面的评论中获取OP的源代码。




Added source code to OP from comments below my solution.

在IE的更高版本中删除了隐藏地址栏的功能。

但是,有一种解决方法:



您需要使用JavaScript来隐藏地址栏,因为无法使用VB 6,ASP.Net等隐藏它:

http://www.javascript-coder.com/window-popup/javascript-window-open.phtml [ ^ ]



欢呼,

Marco
The feature of hiding the adress bar was removed in later versions of IE.
However, there is a workaround:

You need to use JavaScript to hide the adress bar, since it is not possible to hide it with VB 6, ASP.Net etc.:
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml[^]

cheers,
Marco