Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 Toolbar IE9
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
 
[Edit, 2013-MAY-27 Marco Bertschi]
Added source code to OP from comments below my solution.
Posted 23-May-13 21:22pm
Edited 26-May-13 22:35pm
v2
Comments
Sergey Alexandrovich Kryukov at 24-May-13 2:48am
   
Why?!
—SA
Member 10072651 at 24-May-13 3:42am
   
Not sure about the problem. When the application is opened in Windows 7 with IE 9.0, the address bar is visible, although it is set to False.
Prasad Khandekar at 24-May-13 3:45am
   
I think the ability to hide address bar was removed in later versions of Internet Explorer as it can pose a security risk.
Member 10072651 at 24-May-13 4:44am
   
Yes. Is there a workaround for it. In our application, we dont have to display the address bar.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
Member 10072651 at 24-May-13 5:39am
   
How to use Javascript in VB6 application?
Member 10072651 at 27-May-13 3:14am
   
Please help. I am trying to hide address bar using Javascript as below. But it throws Run time error '5009' : window is undefined.
 
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
Marco Bertschi at 27-May-13 3:36am
   
You can't use javascript directly on your VB 6 code - JavaScript is a script language for web pages only.
Member 10072651 at 27-May-13 4:40am
   
Ok. Thanks for your reply. We are trying to open a browser window without toolbar. What can we do? Do we have any other option?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 27 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100