Prevent Window Caption showing on form.show

G

Guest

Hello,

I am writing a c# pocket pc application. The method used to show forms (eg.
from a menu button) is to create a new instance of the form, and show it....

Cursor.Current = Cursors.WaitCursor;
frmFormClass frmNext = new frmFormClass();
frmNext.Show();
Cursor.Current = Cursors.Default;

The forms themselves are designed to be totally full screen, ie. no caption,
and no start bar. For this, the properties on the forms are set as follows:

ControlBox = false
FormBorderStyle = none
Size = 240,320
WindowState = Maximised

Also, in the form Load eventhandler, i have the code:

this.MaximizeBox = false;
this.MinimizeBox = false;
this.WindowState = FormWindowState.Maximized;
this.Top = 0;
this.Left = 0;
this.Height = 320;
this.Width = 240;

This all works as far as showing the forms in 'kiosk' mode, but when the
form loads, the default blue window caption, with the class name, is
displayed at the top of each form briefly before it maximises. I have been
unable to find a way to suppress this. I just want the form to display
smoothly in fully maximised form.

This method is also used in a vb.net ppc project, without the problem.

Any suggestions to get rid of this behaviour would be appreciated.

Thanks,
 
G

Guest

Thanks Peter.

It's not that i don't want the class name showing, it's that i don't want
the caption bar itself showing.

I've actually just found that removing all the code from the form.load event
except for the 'this.WindowState = FormWindowState.Maximized;' line fixes the
problem.

Without this line, the form is maximised, but positioned down the screen at
the position under where the caption bar would be. So it needs the
windowstate line, but keeping in the other positioning lines flashes up the
caption. Seems odd to me, but it's working...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top