I've attached a small example about the issue. How can I hide the control box completely during Maximize and Minimize the Borderless Form
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Security;
using System.Threading;
namespace TalkTime
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private const int WM_NCPAINT = 0x0085;
protected override void WndProc(ref Message m)
{
int message = m.Msg;
switch (m.Msg)
{
case WM_NCPAINT:
{
Thread.Sleep(100);
return;
}
}
base.WndProc(ref m);
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style |= 0x20000;
return cp;
}
}
}
}
I put the thread to show where is the problem exactly.
The black rectangle which is I guess related to the controlbox and form name will appear before the form while I want to hide it completely while maximizing and minimizing.