|
-
Aug 14th, 2003, 11:08 AM
#1
Thread Starter
New Member
Web Browser Control
Anybody who knows-
I have a WB control in my app that only accesses local files in offline mode. My app modifies CSS and writes them back to the drive. I would like to refresh the page in the WB Control to show the changes.
I tried the Refresh() method, which does nothing. I don't want to have to re-navigate to the page, because you then lose the position you were at in the page.
Any ideas?
Thanks-
Erik
-
Aug 14th, 2003, 11:20 AM
#2
Addicted Member
May i Suggest
May be this helps...
U Need to Navigate Back to The Same Page!
You won't loose the locations if the URL is kept somewhere
In a Control or Variables.
VB Code:
Private Sub Command1_Click()
With WebB
.Navigate "http://www.anywhere.com"
End With
End Sub
I may have interpret your post wrongly
Correct me if I made a mistake...
Hope This Helps.. .....Enjoy Coding.....//
zak2zak
-
Aug 14th, 2003, 11:52 AM
#3
Frenzied Member
WebBrowser1.Refresh should work just fine, but anyway here is another way to do it.
Code:
WebBrowser1.Document.location.reload
-
Aug 14th, 2003, 02:49 PM
#4
Thread Starter
New Member
I tried both of these methods. Unfortunately, they both still take me back to the top of the html page when they Navigate() or reload().
Is there any way to get/set a property that tells you how far down in a page you are, that you can set when the page reloads?
Thanks for your suggestions-
Erik
-
Aug 14th, 2003, 02:57 PM
#5
Thread Starter
New Member
BTW, I am using VB.NET, if that makes a difference.
Thanks-
Erik
Edited & added: Oh yeah, and also, I AM able to refresh it manually by right clicking and choosing "Refresh" when the app is running. Why won't the code do this?
I even tried doing a sendkey in the code:
System.Windows.Forms.SendKeys.Send("{f5}")
While manually hitting F5 when the program runs takes you back to the right spot in the page, using the sendkey command causes it to go back to the top of the page, yet again!
Last edited by Erik Johnson; Aug 14th, 2003 at 03:39 PM.
-
Aug 14th, 2003, 03:37 PM
#6
Hyperactive Member
Originally posted by Erik Johnson
I tried both of these methods. Unfortunately, they both still take me back to the top of the html page when they Navigate() or reload().
Is there any way to get/set a property that tells you how far down in a page you are, that you can set when the page reloads?
Thanks for your suggestions-
Erik
Refresh is how to do it..... and I dont believe what you want is possible (at least built into the web control). you might be able to get the scroll bar value with SendMessage and then reset that value after u refresh the page.....
-
Aug 14th, 2003, 03:48 PM
#7
Thread Starter
New Member
How exactly would I get the scroll bar value with SendMessage? Will I have a hard time trying to figure that out if I don't already know how to do it?
Thanks for your help-
ERik
-
Aug 14th, 2003, 03:51 PM
#8
Hyperactive Member
check out the WM_* messages in the MSDN and look for the one you want (if it exists) ..... Another option would be to subclass the webbrowser control and intercept the WM_VSCROLL / WM_HSCROLL messages and keep saving the last position.
-
Aug 14th, 2003, 04:58 PM
#9
Thread Starter
New Member
On a whim, I tried this:
WBControl.ExecWB(SHDocVw.OLECMDID.OLECMDID_REFRESH, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER)
AND IT WORKS!!!
Thanks-
Erik
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
|