Hello,
I'm using the webbrowser control to display a webpage on my form. The first
problem is the gets fired for every image which is completed as well.
http://support.microsoft.com/?id=180366 describes a solution but I'm not
able to port the if to C# :
VB
---
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object,
URL As Variant)
If (pDisp Is WebBrowser1.Object) Then
Debug.Print "Web document is finished downloading"
End If
End Sub
C#
---
private void IE_DocumentComplete(object sender,
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
if (????????????????????????)
MessageBox.Show("finished loading");
}
Then I want to use reflection to fill in a field on the form.
object [] _name = {"q"}; // the textbox to fill
object [] _value = {"value", "hello world"}; // the text to fill it with
object o = IE.Document.GetType().InvokeMember("getElemenById" ,
System.Reflection.BindingFlags.InvokeMethod, null, IE.Document, _name);
o.GetType().InvokeMember("setAttribute",
System.Reflection.BindingFlags.InvokeMethod, null, o, _value);
The above code compiles but when run it just hangs on "object o = ..." and I
don't see any reason why. Any ideas ?
TIA
Yves