Answer the question
In order to leave comments, you need to log in
How to trigger native form animations when using BorderStyle None?
Good afternoon. I need to change the color of the form's top border, as I found out, the best way to do this is to set the BorderStyle property to None. I created the top panel, but when switching WindowState, minimization/maximization occurs abruptly, i.e. without animation. How to trigger or play this animation?
I also use the following code to move the form
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();
private void MyTopPanel_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
Answer the question
In order to leave comments, you need to log in
No relatives. This is what the operating system does. It will be difficult to implement such functionality on your own.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question