|
-
Jan 12th, 2008, 10:46 AM
#1
Thread Starter
Frenzied Member
-
Jan 12th, 2008, 12:30 PM
#2
Re: Openning New Window Using Web Browser Control
How are you specifying the new link to go to? Dont use the webbrowsers Navigate2 or similar method. Use an anchor tag in the link to open on your page. And maybe evevn specify the "Target=_New" tag too.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 12th, 2008, 02:57 PM
#3
Thread Starter
Frenzied Member
-
Jan 12th, 2008, 05:14 PM
#4
Thread Starter
Frenzied Member
Re: Openning New Window Using Web Browser Control
The WebBrowser control has an event named ClientToHostWindow which expects 2 parameters - CX & CY. With the following code, to some extent I could make the new browser window open as it has been programmed to open (in a smaller window):
Code:
Private Sub wWeb_ClientToHostWindow(CX As Long, CY As Long)
Me.WindowState = vbNormal
Me.Width = CX * Screen.TwipsPerPixelX
Me.Height = CY * Screen.TwipsPerPixelY
End Sub
When I clicked the Manage Attachments button in this forum (on the page where one has to type his question), it opened a new smaller window with the correct dimensions (i.e. the width & height of the Form was the same as the width & height of the browser & hence no part of the underlying Form was visible) but I coded a simple HTML page with a button & the following code:
Code:
<html>
<head>
<script language="JavaScript">
function newWindow(){
newWin=open("NewWindow.html","popup","top=20,left=200,width=500,height=470,location=no,status=no,directories=no,scrollbars=no")
}
</script>
</head>
<body>
<input type=button value="OPEN NEW WINDOW" onClick="newWindow()">
</body>
</html>
so that a new window with smaller dimensions opens up when the OPEN NEW WINDOW button is clicked but when I clicked the button to open a new window, though the width & the height of the new browser opened as it has been set in the above JavaScript code, the width of the Form far exceeded the width of the browser & hence a large part of the underlying Form was still visible.
The reason why clicking the Manage Attachments button opened the new window with the correct dimensions but clicking the OPEN NEW WINDOW didn't could be due to the way in which the 2 buttons are coded to open the new window. Maybe the Manage Attachments button has not been coded using the JavaScript open method to open the new window which is how I have made the new browser to open though I couldn't detect it by having a look at the source code.
Any other suggestions, friend?
ARPAN
IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!
NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!
PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?
-
Jan 13th, 2008, 05:04 AM
#5
Re: Openning New Window Using Web Browser Control
Well you didnt explain all that in your first post so it seems you have it under control now. Btw, the manage attachments button does use some complex JavaScript to open the new window instance.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 14th, 2008, 07:29 AM
#6
Thread Starter
Frenzied Member
-
Jan 14th, 2008, 11:31 AM
#7
Re: Openning New Window Using Web Browser Control
Well as you can see from the sites code that it has its own procedure for doing so - open_window. If you view the source of the calling page by right clicking and selecting "View Source" you will see what I mean.
Are you trying to automate VBF or ??? because this will be different for other sites.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 14th, 2008, 12:40 PM
#8
Thread Starter
Frenzied Member
-
Jan 14th, 2008, 12:43 PM
#9
Re: Openning New Window Using Web Browser Control
Then dont use VBF as your example as its a specific situation and its new windows are not handled the same way other sites do. Well maybe someone else can "spend" their time on this then.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 14th, 2008, 12:55 PM
#10
Thread Starter
Frenzied Member
-
Jan 16th, 2008, 09:01 AM
#11
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|