diff --git a/Media/Flash.cs b/Media/Flash.cs index ab4fdd17..032053e2 100644 --- a/Media/Flash.cs +++ b/Media/Flash.cs @@ -34,7 +34,8 @@ class Flash private string _backgroundColor; private string _backgroundTop; private string _backgroundLeft; - + private bool _disposed = false; + public Flash (RegionOptions options) : base(options.width, options.height, options.top, options.left) { @@ -71,6 +72,10 @@ public Flash (RegionOptions options) // Navigate to temp file _webBrowser.Navigate(_tempHtml.Path); + Controls.Add(_webBrowser); + + // Show the control + Show(); } /// @@ -101,9 +106,12 @@ private void GenerateHeadHtml() /// void _webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { - // We have navigated to the temporary file. - Show(); - Controls.Add(_webBrowser); + base.StartTimer(); + + if (_disposed) + return; + + _webBrowser.Visible = true; } /// @@ -112,6 +120,7 @@ void _webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEve /// protected override void Dispose(bool disposing) { + _disposed = true; if (disposing) { // Remove the webbrowser control