Open wk-j opened 8 years ago
In MaterialForm if set WindowsState to Maximized (in Properties Windows) form will display as fullscreen.
MaterialForm
WindowsState
Maximized
Problem
I'm try to fix with this code but restore button still not working.
private void Form_Load(object sender, EventArgs e) { MaximizeWindow(true); } /* Fix Full Screen */ private Size previousSize; private Point previousLocation; private const int MONITOR_DEFAULTTONEAREST = 2; private void MaximizeWindow(bool maximize) { if (maximize) { IntPtr monitorHandle = MonitorFromWindow(Handle, MONITOR_DEFAULTTONEAREST); MONITORINFOEX monitorInfo = new MONITORINFOEX(); GetMonitorInfo(new HandleRef(null, monitorHandle), monitorInfo); previousSize = Size; previousLocation = Location; Size = new Size(monitorInfo.rcWork.Width(), monitorInfo.rcWork.Height()); Location = new Point(monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.top); } else { Size = previousSize; Location = previousLocation; } }
In
MaterialForm
if setWindowsState
toMaximized
(in Properties Windows) form will display as fullscreen.Problem
I'm try to fix with this code but restore button still not working.