winzip icon

Webbrowser control replacement and upgrade

Email
Submitted on: 2/18/2015 12:26:00 PM
By: David Breau (from psc cd)  
Level: Intermediate
User Rating: By 14 Users
Compatibility: VB 6.0
Views: 8322
 
     Are you sick of the webbrowser control and all its bugs and problems? Especially since the change from IE6 to IE7. Seems like microsoft goes out of its way to make programming difficult. Well this control called the IE controler is a solution that I came up with that works and works great!! With this control you can create a hidden or visible instance of IE and set it (the visible one) as a child of any control on your form like a picturebox. With this control you have easy access to all of the webbrowsers built in functions and properties as well as the underlying document. With one line of code you can have access and control to all the documents elements such as its links, images, forms, tables, table cells, etc. The possibilites will excite you. Here are some of the routines and what they can do for you. Functions/subs LinkByText: returns a link in the document whose text matches desired value Go: makes the browser go back, forward, home, or search return_links: returns, in event, all the anchor objects in the document return_tables: returns, in event, all the table objects in the document return_forms: returns, in event, all the form objects in the document return_images: returns, in event, all the image objects in the document return_tablerows: returns, in event, all the tr objects in the document return_tabledowns: returns, in event, all the td objects in the document CreateHiddenDocument: creates a hidden webpage from the url passed to it, from which you can extract and manipulate all of the objects and elements on it. WriteHtmlToDoc: allows you to insert your own html within the browser createIE: creates a visible instance of ie and navigates to the url you specify. You have the option of removing its titlebar, make it unresizable, make it the child of any control on your form which has the visible effect of embedding the ie browser seemlessly into your application. bShowContextMenu: Allow or disallow the right click context menu Events Event IEDocReady(odoc As HTMLDocument) Event IEdocState(state As String) Event HiddenDocReady(odoc As HTMLDocument, surl As String) Event HiddenDocState(state As String) Event HiddenDocTimeout(lelapsed As Long) Event IEDownloadStart() Event IEDownloadDone() Event returnedLinks(olink As HTMLAnchorElement, cnt As Integer) Event returnedImages(oimage As HTMLImg, cnt As Integer) Event returnedForms(oform As HTMLFormElement, cnt As Integer) Event returnedTables(otable As HTMLTable, cnt As Integer) Event returnedTableRows(oTr As HTMLTableRow, cnt As Integer) Event returnedTableDowns(oTd As HTMLTableCell, cnt As Integer) Event contextMenu() Event mousedown(ibutton As Integer) Event closing() Event IEcreated() Event processingDone(sFunctionName As String) Event Error(sProcName As String, iErrNum As Long, sErrDescr As String) Event NewWindow()
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

1/6/2017 8:24:19 PMHasan

EXCELLENT
I cannot find a way how to use bShowContextMenu.
Have you example?
Thank you

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.