How to hide form header when switching between forms on Winmobile 6.5
-
25-09-2019 - |
Question
I have two simple forms designed in maximized view. when switching between them (showing second and hiding first), the second form first shows its header for some miliseconds. Than the header dissapears.
How to avoid showing the header?
Thanks.
Solution
This is a tricky one. You can use SetWindowsPos windows api call. To move the header out from the screen. Then when closing the application or on a crash you can put it back. This trick can cause some problems, when there are background stuff happening in windows. I use this only when switching between .exe - form files.
I think a better solution for this problem is to use one Form, but have different UserControls. It will look something like this.
public class MainForm : Form
{
public void AddView(UserControl view)
{
SuspendLayout();
Controls.Add(view);
ResumeLayout(true);
}
}
OTHER TIPS
Have you set the FormBorderSytle to None?