Maximized borderless forms on Pocket PC
Hi,
after migrating an existing application to .NET CF 2.0 I experience
an ugly behaviour with my maximized, borderless forms:
I'm displaying stacked modal forms e.g. one modal form opens another,
then that one closes etc. The not-so-nice thing is that now under CF 2.0,
the Windows Start menu is briefly visible between the close of the child form
and the redraw of the parent form.
This was working nicely under CF 1.0 and seems to be a problem of CF 2.0.
Any ideas or workarounds?
Thanks,
Detlev
Hi Detlev. I'm using a recent build of netcf v2 and wasn't able to reproduce your problem on a PPC 2003 SE device. I'm a little confused in your message where you said "...then that one closes".
Here's the code that I have that shows modal maximized, borderless forms but I never see the start menu. Could you a) try this code and see if it reproduces the problem for you, b) modify it so it does reproduce the problem and send it back to me?
thanks
mike
| |
using System; using System.Drawing; using System.Windows.Forms; class Test : System.Windows.Forms.Form { MenuItem menuRun, menuExit; static int ID = 0; public Label label; public Test() { this.MinimizeBox = false; this.Text = "form " + Test.ID; this.Menu = new MainMenu(); this.menuRun = AddMenuItem(this.Menu, "showModal"); this.menuExit = AddMenuItem(this.Menu, "Exit"); this.label = new Label(); this.label.Parent = this; this.label.Text = this.Text; } MenuItem AddMenuItem(Menu parent, string text) { MenuItem menu = new MenuItem(); menu.Text = text; menu.Click += new EventHandler(this.menu_Click); parent.MenuItems.Add(menu); return menu; } protected void menu_Click(object o, EventArgs e) { MenuItem menu = (MenuItem)o; if(menu == this.menuRun) StartTest(); else if(menu == this.menuExit) this.Close(); } void StartTest() { Test x = new Test(); x.FormBorderStyle = FormBorderStyle.None; x.WindowState = FormWindowState.Maximized; // set the text so I know what form I'm looking at x.Text = "dialog " + ++Test.ID; x.label.Text = x.Text; // this prevents all the dialogs from showing up in the PPC task list x.Owner = this; x.ShowDialog(); } static void Main(string[] args) { Test x = new Test(); Application.Run(x); } }
|
Hi Michael,
I had posted a followup and revised description after this original post which I can't find anymore. But the trick to reproduce is to NOT have a main menu on the form. I actually posted this as a bug at:
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=a0824e38-cc78-4eb4-8717-b9f34d30f987
My original description in this thread (to which you have answered) was not
sufficient enough to reproduce the effect. The border style is actually not important. But the size has to be 240x320. The "bug" also shows on the emulator
btw.
Regards,
Detlev