[Mono-bugs] [Bug 508585] New: Form.Refresh() force reloading of WebBrowser control

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun May 31 18:37:47 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=508585


           Summary: Form.Refresh() force reloading of WebBrowser control
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: Other
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: ctype at mail.ru
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:
Form.Refresh() enforce the WebBrowser to reload content. 
On Microsoft.Net this not happen anyway. 



Steps to reproduce the problem:

using System;

using System.Collections.Generic;

using System.Drawing;

using System.Windows.Forms;





namespace RefreshAndWebBrowser

{

    public class TestForm : Form

    {

        [STAThread]

        private static void Main(string[] args)

        {

            Application.EnableVisualStyles();

            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new TestForm());

        }



        private System.Windows.Forms.WebBrowser browser;



        void MainFormLoad(object sender, EventArgs e)

        {

            browser.Navigate(new Uri("http://www.google.com"));

            while(browser.ReadyState != WebBrowserReadyState.Complete)

                Application.DoEvents();



            browser.Navigating += BrowserNavigating;

            Refresh();

        }



        void BrowserNavigating(object sender, WebBrowserNavigatingEventArgs e)

        {

            throw new Exception("Refresh raised");

        }





        public TestForm()

        {

            this.browser = new System.Windows.Forms.WebBrowser();

            this.SuspendLayout();

            this.browser.Dock = System.Windows.Forms.DockStyle.Fill;

            this.browser.Name = "browser";



            this.ClientSize = new System.Drawing.Size(292, 266);

            this.Controls.Add(this.browser);

            this.Name = "MainForm";

            this.Text = "SuspendLayoutAndWebBrowser";



            this.ResumeLayout(false);

            this.Load += MainFormLoad;

        }



    }

}

Actual Results:
Unhandled Exception: System.Exception: Refresh raised
at RefreshAndWebBrowser.TestForm.BrowserNavigating
(object,System.Windows.Forms.WebBrowserNavigatingEventArgs) <0x00031>
at System.Windows.Forms.WebBrowser.OnNavigating
(System.Windows.Forms.WebBrowserNavigatingEventArgs) <0x00026>
at System.Windows.Forms.WebBrowser.OnWebHostLoadStarted
(object,Mono.WebBrowser.LoadStartedEventArgs) <0x00092>
at Mono.Mozilla.Callback.OnStateChange
(Mono.Mozilla.nsIWebProgress,Mono.Mozilla.nsIRequest,int,uint) <0x003ef>
at (wrapper native-to-managed) Mono.Mozilla.Callback.OnStateChange
(intptr,intptr,int,uint) <0x002c1>


Expected Results:
Run without errors

How often does this happen? 
Always


Additional Information:

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list