You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting position of the form to be on left of 3 screens (Screen.AllScreens[0]), the form window can not be moved. The cursor changes to resize arrow when hovering the form (not only header. Also Only resizing the window is possible.
Strange is that it works fine on center and right screen. It works fine with MaterialForm.
Partial class as example for a blank designer created form.
public partial class TEST : MetroForm
{
public TEST()
{
InitializeComponent();
this.ShowHeader = true;
this.ShowLeftRect = false;
MoveFormToCenterOfSecondaryScreen(this);
}
public void MoveFormToCenterOfSecondaryScreen(Form form)
{
// Check if there is more than one screen (secondary screen exists)
if (Screen.AllScreens.Length > 1)
{
// Get the secondary screen (usually the second in the list)
Screen secondaryScreen = Screen.AllScreens[0];
// Get the working area of the secondary screen (excludes taskbar and other docked elements)
Rectangle workingArea = secondaryScreen.WorkingArea;
// Calculate the centered position
int centerX = workingArea.Left + (workingArea.Width - form.Width) / 2;
int centerY = workingArea.Top + (workingArea.Height - form.Height) / 2;
// Move the form to the center of the secondary screen
form.StartPosition = FormStartPosition.Manual;
form.Location = new Point(centerX, centerY);
}
else
{
// If there's no secondary screen, fallback to center on the primary screen
form.StartPosition = FormStartPosition.CenterScreen;
}
}
}
Version
3.8.0.7
The text was updated successfully, but these errors were encountered:
Bug explanation
When setting position of the form to be on left of 3 screens (Screen.AllScreens[0]), the form window can not be moved. The cursor changes to resize arrow when hovering the form (not only header. Also Only resizing the window is possible.
Strange is that it works fine on center and right screen. It works fine with MaterialForm.
Partial class as example for a blank designer created form.
Version
3.8.0.7
The text was updated successfully, but these errors were encountered: