WPF Add ActiveX Control--system.windows.forms.axhost+invalidactivexstateexception exception

Source: Internet
Author: User
Tags ole

---restore content starts---

I. ActiveX and its related concepts

(Component object model, Object component model), DCOM (Distributed COM, distributed object Component model), CORBA (Common object Request Broker Architecture, public Object Request Broker architecture), Dynamic Data Exchange (Exchange,dde), which solves the data update, but the data format is still a problem; objects are linked and embedded (object linking and Embedded,ole), Data exchange increases to "object Exchange"; ActiveX refers to loosely defined, COM-based technology collections, while OLE still refers only to compound documents; The biggest difference between ActiveX and OLE is that OLE is for integration between applications and files on the desktop, and ActiveX provides further web-based applications and user interaction. Second, WPF joins ActiveX controls

Use the windowsformshost element to place a Windows forms control into a WPF element or page.

To host a WPF element in a Windows forms control or form, use the ElementHost control

1. Add Reference windowsformsintegration; 2. Create WindowsFormsHost Object

System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost ();

3. Instantiate ActiveX controls, initialize controls, control complex values to host

TXSL1 = new ActiveX ();

Host. Child = TXSL1;

4. Add the Host object to the WPF form

THIS.MAINGRID.CHILDREN.ADD (host);

---restore content ends---

WPF Add ActiveX Control--system.windows.forms.axhost+invalidactivexstateexception exception

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.