mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-25 19:38:37 +08:00
36 lines
1001 B
C#
36 lines
1001 B
C#
using System.Windows.Forms;
|
|
using mRemoteNG.UI.Forms;
|
|
using WeifenLuo.WinFormsUI.Docking;
|
|
|
|
namespace mRemoteNG.App
|
|
{
|
|
public static class Screens
|
|
{
|
|
public static void SendFormToScreen(Screen screen)
|
|
{
|
|
var frmMain = FrmMain.Default;
|
|
var wasMax = false;
|
|
|
|
if (frmMain.WindowState == FormWindowState.Maximized)
|
|
{
|
|
wasMax = true;
|
|
frmMain.WindowState = FormWindowState.Normal;
|
|
}
|
|
|
|
frmMain.Location = screen.Bounds.Location;
|
|
|
|
if (wasMax)
|
|
{
|
|
frmMain.WindowState = FormWindowState.Maximized;
|
|
}
|
|
}
|
|
|
|
public static void SendPanelToScreen(DockContent panel, Screen screen)
|
|
{
|
|
panel.DockState = DockState.Float;
|
|
if (panel.ParentForm == null) return;
|
|
panel.ParentForm.Left = screen.Bounds.Location.X;
|
|
panel.ParentForm.Top = screen.Bounds.Location.Y;
|
|
}
|
|
}
|
|
} |