문제

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.

도움이 되었습니까?

해결책

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

다른 팁

Have you set the FormBorderSytle to None?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top