-
Feb 3rd, 2014, 05:10 AM
#121
Member
Re: Webbrowser Control Tip and Examples
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?
-
Sep 29th, 2014, 03:59 PM
#122
New Member
Re: Webbrowser Control Tip and Examples
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.
-
Feb 20th, 2015, 07:30 AM
#123
New Member
Re: Webbrowser Control Tip and Examples
Hello. Im using VB.net. I need a way of getting the awebsite favicon. Can you help?
-
Feb 20th, 2015, 07:10 PM
#124
Re: Webbrowser Control Tip and Examples
I would suggest posting your query to the NET section of the forum.
<--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
If topic has been resolved, please pull down the Thread Tools & mark it Resolved.
Is VB consuming your life, and is that a bad thing??
-
Mar 27th, 2015, 04:52 AM
#125
New Member
Re: Webbrowser Control Tip and Examples
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!
-
Mar 30th, 2015, 05:03 AM
#126
Re: Webbrowser Control Tip and Examples
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.
-
Jul 11th, 2015, 08:26 AM
#127
Member
Re: how to Pick a text from Table in a page
Animated Browser Complete:
2 images: 1 The animation Gif. 2 The Still Image. I use these
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.
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
Then when ever I navigate, go forward, go back, refresh I have this code.
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
Now you have animated your navigation and can stop wondering if your click on the button took or not.
Disclaimer: Though this code is in VB2010, I am sure the same principle can be used in older compilers.
Last edited by teamster; Jul 11th, 2015 at 08:29 AM.
Reason: added disclaimer
-
Jan 12th, 2017, 12:38 PM
#128
Hyperactive Member
Re: Webbrowser Control Tip and Examples
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
-
Jan 12th, 2017, 01:59 PM
#129
Re: Webbrowser Control Tip and Examples
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
-
Jan 13th, 2017, 10:50 AM
#130
Hyperactive Member
Re: Webbrowser Control Tip and Examples
Originally Posted by DEXWERX
you should post in a new thread.
There's many ways - but the most obvious is something like this.
Thanks Dex, very helpful of you!
As a follow question to your suggested solution. The Div always appears as a new line. Is there a way to have it stay on the current line and not start a new line?
Last edited by AAraya; Jan 13th, 2017 at 11:45 AM.
-
Jan 13th, 2017, 11:02 AM
#131
Hyperactive Member
Re: Webbrowser Control Tip and Examples
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
Last edited by AAraya; Jan 13th, 2017 at 11:18 AM.
-
Jan 13th, 2017, 12:03 PM
#132
Hyperactive Member
Re: Webbrowser Control Tip and Examples
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
-
Nov 21st, 2017, 05:33 AM
#133
New Member
Re: Webbrowser Control Tip and Examples
Does anyone know what the extra arguments do when using navigate?
-
Dec 21st, 2017, 11:10 AM
#134
New Member
Re: Webbrowser Control Tip and Examples
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 loaded
wb.Navigate2 "about :blank"
While wb.ReadyState <> SHDocVwCtl.tagREADYSTATE.READYSTATE_COMPLETE
DoEvents Wend
' 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 browser
oPersistStreamInit.Load oStream End If
Set oStream = Nothing
Set oPersistStreamInit = Nothing End Sub
-
Oct 2nd, 2023, 01:52 PM
#135
PowerPoster
Re: how to Pick a text from Table in a page
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
|