I am posting html data with web form.. and i check my web page.. i dont see the iframe codes.. why wb component replacing iframe codes?
Printable View
I am posting html data with web form.. and i check my web page.. i dont see the iframe codes.. why wb component replacing iframe codes?
Is there any way to changing WebBrowser Document Location without navigating?
Actually i want to make a browsing control with socket connection, Because i have many Forms Data to submit directly through links.
I use to navigate about:blank on form_load event. But the images are not showing because of browser location is "about:blank"
I need to change it to my specific location. I've tried by adding base url in <head> tag when the source is loading but that didn't work.
Hello. Im using VB.net. I need a way of getting the awebsite favicon. Can you help?
I would suggest posting your query to the NET section of the forum.
I have a question, maybe this is the wrong thread...
I have a little "Windows Form1" and it has very basic WebBrowser made with Studio Community 2013. WebBrowser is fills the whole Form1. If I give it a static url in WebBrowser properties, it navigates to that address no problem. Is is possible to make it navigate something like variable that is given when calling this Form1.exe from CMD example?
My idea is that normally when you call that exe it will open the window and navigate to www.google.fi for example. But if I call it for exampl "Form1.exe www.bing.com" or "Form1.exe -p1www.bing.com" or something like that, it would open the window and navigate to www.bing.com.
This should be possible but how? I'm new using Studio and at has been a while when I coded these applicatios...
Thanks!
Then you are using VB.NET, this section is dedicated to VB6 and older.
So ask your question in a new thread in the correct forum.
Animated Browser Complete:
2 images: 1 The animation Gif. 2 The Still Image. I use these Attachment 128315Attachment 128313
Set the visible property to False and stage them one on top of the other around the URL textbox.
I named the PictureBox of each to "Complete" for the still image, and "Loading" for the animated gif.
Then Under document complete I have this code.
Then when ever I navigate, go forward, go back, refresh I have this code.Code:Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Loading.Visible = False
Complete.Visible = True
End Sub
Now you have animated your navigation and can stop wondering if your click on the button took or not.Code:Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
'This is the GO button.
WebBrowser1.Navigate(TextBoxURL.Text)
Loading.Visible = True
Complete.Visible = False
End Sub
Private Sub Button13_Click(sender As System.Object, e As System.EventArgs) Handles Button13.Click
'This is the FORWARD button
WebBrowser1.GoForward()
Loading.Visible = True
Complete.Visible = False
End Sub
Private Sub Button12_Click(sender As System.Object, e As System.EventArgs) Handles Button12.Click
'This is the BACK button
WebBrowser1.GoBack()
Loading.Visible = True
Complete.Visible = False
End Sub
Private Sub Button11_Click(sender As System.Object, e As System.EventArgs) Handles Button11.Click
'This is the REFRESH button
WebBrowser1.Refresh()
Loading.Visible = True
Complete.Visible = False
End Sub
Disclaimer: Though this code is in VB2010, I am sure the same principle can be used in older compilers.
I'm using the browser control to display html code I generate myself. I want to display a link which doesn't actually navigate anywhere (the link is not for navigation, it's to trigger an action.) and I want to know when the user clicks on the link. How is this achieved?
two questions:
1. how do I create a hyperlink like this - e.g. Click here to do such and such...
2. Is an event raised somewhere when the link is clicked on by the user? I don't want the browser to automatically navigate anywhere when the user clicks on the link. I want to take some other action in my app when the user clicks on the link.
TIA,
Art
you should post in a new thread.
There's many ways - but the most obvious is something like this.
Code:<div id='DoSomething' style='text-decoration: underline; cursor:pointer;'>A Link!</div>
Code:Private WithEvents MyDiv As HTMLDivElement
Private Function MyDiv_onclick() As Boolean
MsgBox "Div Clicked!"
End Function
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Set MyDiv = WebBrowser1.Document.getElementById("DoSomething")
End Sub
I spent days searching this one out so it may be of help to someone else.
Change the border style from 3d to flat:
Code:Private Sub WebBrowser_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
WebBrowser.Document.Body.style.border = "none"
End Sub
The Custom Right Click Menu code also seems to work as an alternate way to disable the context menu without requiring subclassing or use of a helper DLL like your earlier solution outlines. Simply use the custom right click menu code you have but omit the line which shows a custom popup menu.
Code:'Must Add Microsoft HTML Object Library
Option Explicit
Public WithEvents HTML As HTMLDocument
Private Function HTML_oncontextmenu() As Boolean
HTML_oncontextmenu = False
End Function
Private Sub Form_Load()
WebBrowser1.Navigate "www.google.com"
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set HTML = Nothing
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, _
URL As Variant)
Set HTML = WebBrowser1.Document
End Sub
Does anyone know what the extra arguments do when using navigate?
Loading HTML content into a WebBrowser control from memory
Works with SVG+XML loading.
References :
- "Loading HTML content into a WebBrowser control from memory", Scott Waletzko (sp!ke), link
- "Loading HTML content from a Stream", MSDN, link
- "[VB6] Modern Shell Interface Type Library - oleexp.tlb - VBForums", fafalone, link
On VB6 IDE, add the following references :
- Microsoft HTML Object Library
- OLEXP - olelib With Modern Interfaces by fafalone, v4.x
and of course Microsoft Internet Controls component.
Code:Private Declare Function CreateStreamOnHGlobal Lib "ole32.dll" (ByRef hGlobal as Any, ByVal fDeleteOnResume as long, ByRef ppstr As Any) As Long
Public Sub loadContent(ByRef wb As SHDocVwCtl.WebBrowser, ByRef htmlDoc as MSHTML.HTMLDocument, ByRef aContents() as Byte)
Dim oPersistStreamInit as IPersistStreamInit
Dim oStream as IStream
' ensure the document is loadedEnd Sub
wb.Navigate2 "about:blank"
While wb.ReadyState <> SHDocVwCtl.tagREADYSTATE.READYSTATE_COMPLETE
DoEventsWend
' get a reference to the document
Set htmlDoc = wb.Document
' initialize the document using the IPersistStreamInit
Set oPersistStreamInit = htmlDoc
oPersistStreamInit.InitNew
' set the content into a stream
If Not CreateStreamOnHGlobal (aContents(0), True, oStream) Then
' load the content into browserEnd If
oPersistStreamInit.Load oStream
Set oStream = Nothing
Set oPersistStreamInit = Nothing
Please help me with
https://www.vbforums.com/showthread....-from-web-page
Tks