HtmlWindow.DomWindow Proprietà

Definizione

Ottiene l'interfaccia non gestita di cui è stato eseguito il wrapping in questa classe.

public:
 property System::Object ^ DomWindow { System::Object ^ get(); };
public object DomWindow { get; }
member this.DomWindow : obj
Public ReadOnly Property DomWindow As Object

Valore della proprietà

Oggetto che può essere eseguito il cast in un IHTMLWindow2puntatore , IHTMLWindow3o IHTMLWindow4 .

Esempio

Nell'esempio di codice seguente viene ottenuto un IHTMLWindow2 puntatore dalla finestra di un documento e viene visualizzato un nuovo documento in una finestra modale.

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

Commenti

Usare i puntatori dell'interfaccia non gestiti sottostanti al dom (Document Object Model) per eseguire metodi non esposti da HtmlWindow.

È necessario aggiungere un riferimento alla MSHTML.dll non gestita per usare DomWindow. Per altre informazioni, vedere Importazione di una libreria di tipi come assembly.

Si applica a

Vedi anche