当前位置:编程学习 > C#/ASP.NET >>

aspx页面的“最小化”按钮如何 最小化 winform 窗口程序



使用winform 的 webBrowser 控件 把页面嵌入到winform窗口里  

aspx页面有最小化按钮 点击 最小化按钮 最小化 winform程序 

请教各位 该如何实现该功能呢? --------------------编程问答-------------------- this.close();关闭
this.WindowState = WindowState.Minimized;最小化 --------------------编程问答-------------------- 是点击页面上面的最小化按钮后  最小化 winform窗体
--------------------编程问答-------------------- 有难度,看看WebBrowser是否有相应的事件传出了? --------------------编程问答-------------------- 这涉及到网页和Winform之间通过浏览器控件通信的问题。没有遇到过,建议采用其他的解决办法。 --------------------编程问答-------------------- 好用的

        public Form27()
        {
            InitializeComponent();

            this.webBrowser1.Navigate("http://localhost:9584/");
            this.webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);

        }

        void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            //throw new NotImplementedException();

            System.Windows.Forms.HtmlDocument HTMLDocument = this.webBrowser1.Document;
            System.Windows.Forms.HtmlElement list1 = HTMLDocument.GetElementById("ctl00$MainContent$btnClick");
            list1.MouseDown += new HtmlElementEventHandler(closeWindw);// // 指定监视
        }

        void closeWindw(object o, EventArgs  e)
        {
            this.WindowState = FormWindowState.Minimized;
        }
--------------------编程问答--------------------
引用 5 楼  的回复:
好用的
C# code

        public Form27()
        {
            InitializeComponent();

            this.webBrowser1.Navigate("http://localhost:9584/");
            this.webBrowser1.DocumentCompleted +=……

果然可以,又学习了,知道但是原理不懂了 --------------------编程问答--------------------
引用 5 楼  的回复:
好用的
C# code

        public Form27()
        {
            InitializeComponent();

            this.webBrowser1.Navigate("http://localhost:9584/");
            this.webBrowser1.DocumentCompleted +=……


这个是 窗体的代码 问题是是 aspx页面不要代码吗?

--------------------编程问答-------------------- HTMLDocument.GetElementById("ctl00$MainContent$btnClick");  这句话  里面的 参数 分别代表的是什么?
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,