Dhtml|web|webbrowser Control
Author: tuenhai.com msn:king#tuenhai.com
Copyright NOTICE: You can reprint, reprint, please be sure to hyperlink form to indicate the original source of the article and author information and this statementhttp://www.Tuenhai.com/
Development tools: Microsoft Visual Studio. NET 2003Operating system: Windows XP
Original: http://www.devx.com/vb2themax/tip/18798
As with other contro
1, first introduce the basic control (drag control everyone will, I do not introduce each), see;2, add Mshtml Reference, the steps are as follows:Solution-Right-click "References"-? Add Reference-Locate the microsoft.mshtml component under. NET-click OK;3. Write the code, double-click the Button1 button to add the event; (note the using MSHTML in the reference class;)Target website: http://admin.3cjz.cn/reg
Although IE8 or a later version of IE is installed on the computer, the WebBrowser control always uses IE7 kernel compatibility mode to display the contents of the Web page, causing many page styles not to display properly, such as IE7 incompatible HTML5. The workaround is to specify the version number that references IE for your process in the registry.Like my program called A.exe.For 32-bit programs:Hkey_
First, let's briefly introduce the webbrowser control, which allows you to add webpage content in the form ., I added Baidu API to form (this is a description in the Baidu map API call blog)
Using this control is actually very simple
(1) Step 1
As long as you enter
Webbrowser1.navigate (application. startuppath + "/map.html"); // The address for storing the w
// Based on q172763 HOWTO: retrieve the top-level iwebbrowser2 interface from an ActiveX Control
Using system;
Using system. componentmodel;
Using system. Windows. forms;
Using system. drawing;
Using system. reflection;
Using system. Security;
Using system. runtime. interopservices;
Using shdocvw;
// Use strongname to apply the customized pemission set
[Assembly: assemblykeyfile (@ "C: \ key. SNK")]
// Q814669 PRB: Strong
When using the ie WebBrowser control in. net, you need to customize component events and styles according to your own needs. In fact, it is very easy to control ie components in. net, and all the functions provided by MSHTML can be used. You can intercept all operation events of a user and obtain the object attributes of the user operation. Below is my reserved c
MFC uses the WebBrowser component to create a scroll view in the dialog box, dynamically create a static text control, and set the message response with the mouse clicked. mfcwebbrowser
MFC Applet:
1. Simple WebBrowser ActiveX plug-in method in MFC:
See blog: http://blog.csdn.net/supermanking/article/details/5866213
2. Create a view in the dialog box (a scr
The progress is displayed when the webbrowser control in C # loads a webpage.
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Private
Void
Webbrowser1_progresschanged (
Object
Sender, webbrowserprogresschangedeventargs E){Progressbar1.visible
=
True
; If (E. currentprogress > 0 ) (E. maximumprogress > 0
Webbrowser is a browser control built in IE, which does not need to be downloaded by users.
I. webbrowser Control2. webbrowder Control Method// Print
Webbrowser1.execwb (6, 1 );
// Print settings
Webbrowser1.execwb (8, 1 );
// Print and preview
Webbrowser1.execwb (7,1 );
There are other usage examples of this componen
In practical applications we may need the WebBrowser control to proactively execute the script we need, and there are two ways to execute the script now.1, WebBrowser control loading script, simple and convenient, suitable for short scripts, unable to perform complex operations.Webbrowser.navigate ("javascript:editor.a
1 . . . .2 3 //The HTML,IDR_HTML1 in the load resource file is the ID of the HTML file in the resource file4wchar_t Self_path[max_path] = {0 };5 GetModuleFileName (NULL, Self_path, MAX_PATH);6 CString Res_url;7Res_url. Format (L"res://%s/%d", Self_path, IDR_HTML1);8 M_webbrowser. Navigate (res_url, NULL, NULL, NULL , or null);9 Ten. . . .Download Source:VC + + uses the HTML file in the WebBrowser control
This article is mainly about WebBrowser control, get the data of table in HTML.Download a Mshtml.dll FirstThe main logic is as follows:Get the object of tableIHTMLDocument2 document = WebBrowser1.Document.DomDocument as IHTMLDocument2;IHTMLElementCollection tables = (ihtmlelementcollection) document.all.tags ("TABLE");if (tables.item () = = null){Gets the object according to the name of FranmeHTMLDocument h
The premise: The environment I am currently testing is Windows Phone 8.1 Silverlight, so the control is WebBrowser, not webview.Doing the project may involve the interaction of the Web page with the backend code, because cross-platform issues may be taken into account, so some links in the company's Web pages need to be handled by the client itself.There are the following HTML sample code (important parts):
The following is a detailed analysis of the use of the WebBrowser control in c #. For more information, see
First, let's briefly introduce the webbrowser control, which allows you to add webpage content in the form ., I added Baidu api to form (this is a description in the Baidu map api call blog)
Using this
Do not jump out of the app because you want to access the Web page inside the app. So to implement a browser. But it's a sad thing. Windows Phone8 's WebBrowser controls already support these features like CanGoBack, Cangoforward,goback,goforwarD, But WP7 did not implement a few forward-and-backward functions. It is also very simple to use in the page, the implementation of the effect as shown.Because the use is very simple. Is the same as
left side of the control window and the left side of the container window
Top
Return or setWebbrowserDistance between the left side of the control window and the top side of the container window
Width
Return or setWebbrowserThe window width, in pixels.
Height
Return or setWebbrowserThe height of the window, in pixels.
Locationname
Returns a string con
The IE control (webbrowser Control) added through SDK or ATL cannot respond to the tab message of the keyboard, which is inconvenient when entering the form. You need to click the input box with the mouse each time, I have seen someArticleIt is said that the response message can be obtained through the idochostshowui interface and the idochostuihandler2 interface
I searched from Baidu and found that most of the items about this control are C #. Only Yang from vckbase wrote an article about this control using COM. In general, I have learned a little bit. I will write it here and I will add it later.
1. Place the webbrowser control in your own program. The
http://blog.csdn.net/tujiaw/article/details/6554994
The problem is this, in WTL I used a WebBrowser control to display the page, but when clicked on the link in the Web page often jump to other browsers to open the link. What I want is to always display the page on my control and not jump to another browser to open it.
1. Add IWebBrowser2
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.