seeHOW TO: Handle Document Events in a Visual C# .NET Application
http://support.microsoft.com/default.aspx?scid=kb;EN-US;312777

解决方案 »

  1.   

    COM与.NET的互操作(初级)
    http://dev.csdn.net/develop/article/25/25265.shtm从COM组件调用.NET组件编程实战
    http://dev.csdn.net/develop/article/23/23438.shtm如何创建COM组件能够调用的.NET装配件
    http://dev.csdn.net/develop/article/21/21259.shtm当COM遇见.NET     
    http://dev.csdn.net/develop/article/16/16684.shtm
    more:
    http://www.csdn.net/Develop/List_Article.asp?KeysWord=com&myclassid=&author=&BigClassId=14&myclassName=&doctype=&whichpage=1
      

  2.   

    谢谢大家的热心解答  刚刚错过了upto(阿球) 的回复,抱歉
      

  3.   

    //需要将system32目录下的mshtml.tlb添加到项目中 private void button1_Click(object sender, System.EventArgs e)
    {
    mshtml.IHTMLDocument2 doc = wb.Document as mshtml.IHTMLDocument2;
    doc.write("<html><body><button id=btn>test</button></body></html>");
    mshtml.HTMLButtonElementEvents_Event btn = doc.all.item("btn", (object)0) as mshtml.HTMLButtonElementEvents_Event;
    btn.onclick += new mshtml.HTMLButtonElementEvents_onclickEventHandler(html_button_onclick);
    } private bool html_button_onclick()
    {
    MessageBox.Show("hello");
    return true;
    }