[Mono-bugs] [Bug 495562] Calling Show() on a maximized form changes Window state to Normal .NET difference
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon Apr 27 00:59:06 EDT 2009
http://bugzilla.novell.com/show_bug.cgi?id=495562
User calberto.cortez at gmail.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=495562#c2
Carlos Alberto Cortez <calberto.cortez at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |calberto.cortez at gmail.com
--- Comment #2 from Carlos Alberto Cortez <calberto.cortez at gmail.com> 2009-04-26 22:59:04 MDT ---
Actually this is a known issue related to our implementation being
asynchronous, which shows for Show (). Basically calling Form.Show () will not
execute all the routines commonly executed in a form being shown, since it gets
'interrupted'.
This doesn't happend with a) Forms calling ShowDialog (), which means the forms
stay *in* the screen, b) Forms passed to Application.Run, also remaining in the
screen, and c) Forms calling Show () when there's already another Form running
- which forces the form to stay alive.
To test that, I tested it with the attached sample:
using System;
using System.Windows.Forms;
namespace ConsoleApplicationRegTest
{
class Program
{
static void Main(string[] args)
{
Form f = new Form ();
Button b = new Button ();
b.Click += delegate
{
Form f2 = new Form ();
f2.WindowState = FormWindowState.Maximized;
f2.Show ();
};
b.Dock = DockStyle.Fill;
b.Text = "show win";
b.Parent = f;
Application.Run (f);
}
}
}
Basically, after running a first Form with Application.Run, we show a second
form after pressing a button - as you can see, this second form is actually
maximized, since *all* the routines are executed for it (inclusing telling the
window manager we want it to be maximized).
As I said, it's a known issue, and it's unlikely to affect real world apps,
since basically nobody uses Form.Show without other forms already running/using
ShowDialog ()/Application.Run
--
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