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

[538 byte] By [DetlevSchwabe] at [2007-12-16]
# 1

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);
}
}

MichaelLippMSFT at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 2
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

DetlevSchwabe at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 3

I found your productFeedback bug. We were able to reproduce your problem and we're now investigating it.

thanks for sending in the issue,
mike

MichaelLippMSFT at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 4

Hi Detlev,

Have you been able to solve the forms issue. I've just migrated from VS 2003 CF 1.0 to VS 2005 CF 2.0 and I'm having the same issue with the forms. Please email me at hassaad@forwardair.com if you have any idea on how to fix that.

Thanks,

Helios07 at 2007-9-9 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...