Before starting the question, I apologize for not using English well.
I don't want to use Border and Minimized/Maximized/Closed buttons in the existing form.
FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
Then, I created Custom Minimized/Maximized/Closed Button.
//Closed
private void imgLblCloseProgram_Click(object sender, EventArgs e) {
this.Close();
}
//Maximized
private void imgLblMaximumProgram_Click(object sender, EventArgs e) {
if(this.WindowState == FormWindowState.Maximized) {
this.WindowState = FormWindowState.Normal;
} else if(this.WindowState == FormWindowState.Normal) {
//this.MaximizedBounds = Screen.FromHandle(this.Handle).WorkingArea; //★★★
this.WindowState = FormWindowState.Maximized; //
}
}
private void tbPnlTopBar_DoubleClick(object sender, EventArgs e) {
imgLblMaximumProgram_Click(imgLblMaximumProgram, e);
}
//Minimized
private void imgLblMinimumProgram_Click(object sender, EventArgs e) {
this.WindowState = FormWindowState.Minimized; //
}
When Clear the annotation, Maximizes without taking up space on the taskbar.
However, if more than one monitors are used, they do not work on screens other than the main screen.
In addition, for the Maximized/Minimized button, there seems to be a built-in animation provided by Windows.
When the Maximized/Minimized was changed via FormWindowState, I confirmed that the animation did not work.
The biggest reason why I want the Low-cost Maximized Button Event is that when I use more than one monitors, I have a issue.
Therefore, I need a way to maximize the form while displaying TaskBar on two or more monitors.
p.s. I want the animation of the maximized/minimized button as well, so the best way to run the maximized/minimized button's event is.