標籤:
---恢複內容開始---
一、ACTIVEX及其相關概念
COM(Component Object Model,對象組件模型);DCOM(Distributed COM,分布式對象組件模型);CORBA(Common Object Request Broker Architecture,公用對象請求代理體繫結構); 動態資料交換(Dynamic Data Exchange,DDE),解決了資料的更新,但資料格式仍是問題;對象的連結與嵌入(Object Linking and Embedded,OLE),資料交換提高到“對象交換”;ActiveX是指寬鬆定義的、基於COM的技術集合,而OLE仍然僅指複合文檔;ActiveX和OLE的最大不同在於,OLE針對的是案頭上應用軟體和檔案之間的整合,而 ActiveX則以提供進一步的網路應用與使用者互動為主。 二、WPF 加入ACtiveX 控制項
使用 WindowsFormsHost 元素可將 Windows Forms控制項放置到 WPF 元素或頁面中。
若要在 Windows Forms控制項或表單中承載 WPF 元素,使用 ElementHost控制項
1.添加引用 WindowsFormsIntegration ; 2.建立 WindowsFormsHost 對象
System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
3.執行個體化Activex控制項 、初始化控制項、控制項複值到host
txsl1 = new activex();
host.Child = txsl1;
4.添加Host對象到WPF 表單
this.mainGrid.Children.Add(host);
---恢複內容結束---
WPF 添加ACTIVEX 控制項 ——System.Windows.Forms.AxHost+InvalidActiveXStateException異常