Using the WebBrowser control to implement the IE browser menu function

Source: Internet
Author: User

This article is about the technology, only support IE browser, please note to readers

The WebBrowser control is the built-in control for IE browser. As the name implies, this control can be viewed as the browser itself. With the WebBrowser control, you can implement some of the menu commands of IE browser.

1. Use

First create this control on the screen through the <object> tab.


2. Calling methods

WEBBROWSER.EXECWB nCmdID, Ncmdexecopt, [Pvain], [pvaout]

The command is executed through the EXECWB method of this control. For example, the opening function of a menu:

Document.all.WebBrowser.ExecWB (a);

3. Parameters of the method

3.1 nCmdID parameters (these parameters can be used to know the function of the corresponding menu by the variable name, which is no longer described individually)


3.2 ncmdexecopt parameter (not know how, the second parameter uses 1)


3.3 Common parameters

WEBBROWSER.EXECWB  //Open WEBBROWSER.EXECWB (2,1)  //Close all IE windows now and open a new window WEBBROWSER.EXECWB (4,1)  // Save page WEBBROWSER.EXECWB (6,1)  //Print WEBBROWSER.EXECWB (7,1)  //Print preview WEBBROWSER.EXECWB (8,1)  // Print Page Setup WEBBROWSER.EXECWB (10,1)//View page Properties WEBBROWSER.EXECWB (15,1)//appear to be revoked, pending confirmation WEBBROWSER.EXECWB (17,1)// Select All WEBBROWSER.EXECWB (22,1)//Refresh WEBBROWSER.EXECWB (45,1)//close the form without prompting

4. Test page

<! DOCTYPE html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.