HtmlElement.DomElement プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

要素の COM IUnknown ポインタ。これを IHTMLElement など HTML 要素のインターフェイスの 1 つにキャストできます。

HtmlElement は、コンポーネント オブジェクト モデル (COM: Component Object Model) を使用して記述された Internet Explorer の DOM ラッパーです。基になる COM インターフェイス (IHTMLElement など) の公開されていないプロパティやメソッドにアクセスする必要がある場合は、このオブジェクトを使用して問い合わせることができます。
アンマネージ インターフェイスを使用するには、MSHTML ライブラリ (mshtml.dll) をアプリケーションにインポートする必要があります。ただし、Invoke メソッドを使用して、公開されていないプロパティやメソッドを実行することもできます。

アンマネージ インターフェイスを使用して、現在選択されているテキストを取得し、それをユーザーが選択した URL のハイパーリンクに変換するコード例を次に示します。このコードは、フォームに WebBrowser1 という名前の WebBrowser コントロールがあり、アンマネージ MSHTML ライブラリを参照としてプロジェクトに追加していることを前提として記述されています。
private void CreateHyperlinkFromSelection() { if (webBrowser1.Document != null) { mshtml.IHTMLDocument2 iDoc = (mshtml.IHTMLDocument2)webBrowser1.Document.DomDocument; if (iDoc != null) { mshtml.IHTMLSelectionObject iSelect = iDoc.selection; if (iSelect == null) { MessageBox.Show("Please select some text before using this command."); return; } mshtml.IHTMLTxtRange txtRange = (mshtml.IHTMLTxtRange)iSelect.createRange(); // Create the link. if (txtRange.queryCommandEnabled("CreateLink")) { Object o = null; txtRange.execCommand("CreateLink", true, o); } } } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


HtmlElement クラス
HtmlElement メンバ
System.Windows.Forms 名前空間
HtmlDocument.DomDocument プロパティ
その他の技術情報
IHTMLElement2 Interface
Weblioに収録されているすべての辞書からHtmlElement.DomElement プロパティを検索する場合は、下記のリンクをクリックしてください。

- HtmlElement.DomElement プロパティのページへのリンク