|
-
Jun 12th, 2008, 03:44 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Wait for webbrowser finish navigate
Is there any little piece of programming to get a process halt until the webbrowser is finished navigating and the control WebBrowser1 is accessible.
My application starts with the webbrowser navigate to a specific url. Then I can manually use a Command1 to copy text from my webbrowser, as I wait to see if the browser has finished.
But I want the program itself to wait for it, indicating the browser is ready and then carry on with he rest of the program, without any Command button pressed...
Is that possible ?
/Kalle
-
Jun 12th, 2008, 04:04 AM
#2
Re: Wait for webbrowser finish navigate
Try using the WebBrowser1_NavigateComplete2 event.
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 
-
Jun 12th, 2008, 04:06 AM
#3
PowerPoster
Re: Wait for webbrowser finish navigate
there is a downloadcomplete event on the webrowser control. maybe if u call the button_click event on that it might solve your problem
-
Jun 12th, 2008, 12:41 PM
#4
Re: Wait for webbrowser finish navigate
-
Jun 13th, 2008, 02:38 AM
#5
Thread Starter
Addicted Member
Re: Wait for webbrowser finish navigate
Well, thanks anyway, iPrank !
This little piece of code worked too fine.... The sub routine kept on and on and on, never stopped...
Found an other code, that keep the program waiting for the webbowser to finish:
Code:
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Do Until WebBrowser1.Busy = False
DoEvents
Sleep 800
Loop
/Kalle
-
Jun 13th, 2008, 02:42 AM
#6
Re: Wait for webbrowser finish navigate
Don't use sleep with interval 800ms. It may slowdown other events - like moving/painting the form - specially when net connection is slow.
Use ~25ms interval.
-
Jun 13th, 2008, 03:04 AM
#7
Thread Starter
Addicted Member
Re: Wait for webbrowser finish navigate
OK ! Thanks !
I've tried several different ms, but not as short as 25 ms. Maybe a reason for other difficulties that I recently wrote about.... (see an other issue...)
-
Jun 13th, 2008, 02:37 PM
#8
Re: Wait for webbrowser finish navigate
Seems you have it working now.
Ps, dont forget to Resolve your thread from the Thread Tools menu so others know its been solved.
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 
-
Jun 14th, 2008, 03:29 AM
#9
Thread Starter
Addicted Member
Re: Wait for webbrowser finish navigate
Yes ! I will resolve it as soon as I get the whole thing working...
Sorry that I've put it in two different threads, but both of them will be cleared (Resolved) when I'm finished...
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
|