HtmlWindow.DomWindow Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the unmanaged interface wrapped by this class.
public:
property System::Object ^ DomWindow { System::Object ^ get(); };
public object DomWindow { get; }
member this.DomWindow : obj
Public ReadOnly Property DomWindow As Object
Property Value
An object that can be cast to an IHTMLWindow2
, IHTMLWindow3
, or IHTMLWindow4
pointer.
Examples
The following code example obtains an IHTMLWindow2
pointer from a document's window and displays a new document in a modal window.
private void ShowModalDialog()
{
if (!(webBrowser1.Document == null))
{
HtmlWindow frame = webBrowser1.Document.Window;
String dialogArguments = "dialogHeight: 250px; dialogWidth: 300px; dialogTop: 300px;" +
"dialogLeft: 300px; edge: Sunken; center: Yes; help: Yes; resizable: No; status: No;";
// Show the dialog.
mshtml.IHTMLWindow2 rawWindow = (mshtml.IHTMLWindow2)frame.DomWindow;
Object o = new Object();
Object args = (Object)dialogArguments;
rawWindow.showModalDialog("http://www.adatum.com/dialogWindow.htm", ref o, ref args);
}
}
Private Sub ShowModalDialog()
If (WebBrowser1.Document IsNot Nothing) Then
Dim Frame As HtmlWindow = WebBrowser1.Document.Window
Dim DialogArguments As String = "dialogHeight: 250px; dialogWidth: 300px; dialogTop: 300px;" & _
"dialogLeft: 300px; edge: Sunken; center: Yes; help: Yes; resizable: No; status: No;"
' Show the dialog.
Dim RawWindow As mshtml.IHTMLWindow2 = Frame.DomWindow
RawWindow.showModalDialog("http://www.adatum.com/dialogWindow.htm", Nothing, CObj(DialogArguments))
End If
End Sub
Remarks
Use the underlying unmanaged interface pointers to the Document Object Model (DOM) to execute methods not exposed by HtmlWindow.
You must add a referenced to the unmanaged MSHTML.dll in order to use DomWindow. For more information, see Importing a Type Library as an Assembly.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기