2017-02-27 15:15:50 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Chess
|
|
|
|
|
{
|
|
|
|
|
public partial class MainForm : Form
|
|
|
|
|
{
|
2017-11-16 18:06:29 +01:00
|
|
|
|
bool _fullscreen = false;
|
|
|
|
|
bool Fullscreen
|
2017-02-27 15:15:50 +01:00
|
|
|
|
{
|
2017-11-16 18:06:29 +01:00
|
|
|
|
get { return _fullscreen; }
|
|
|
|
|
set { _fullscreen = value; RefreshFullScreen(); }
|
2017-02-27 15:15:50 +01:00
|
|
|
|
}
|
|
|
|
|
public MainForm()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RefreshFullScreen()
|
|
|
|
|
{
|
|
|
|
|
this.SuspendLayout();
|
2017-11-16 18:06:29 +01:00
|
|
|
|
if (Fullscreen)
|
2017-02-27 15:15:50 +01:00
|
|
|
|
{
|
|
|
|
|
this.WindowState = FormWindowState.Normal;
|
|
|
|
|
this.FormBorderStyle = FormBorderStyle.None;
|
|
|
|
|
this.Bounds = Screen.PrimaryScreen.Bounds;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.FormBorderStyle = FormBorderStyle.Sizable;
|
|
|
|
|
this.WindowState = FormWindowState.Maximized;
|
|
|
|
|
}
|
|
|
|
|
this.ResumeLayout(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void MainForm_KeyUp(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.KeyCode == Keys.F11)
|
2017-11-16 18:06:29 +01:00
|
|
|
|
Fullscreen = !Fullscreen;
|
2017-02-27 15:15:50 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
chessGame.FormClosing(sender, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void MainForm_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
2017-11-16 18:06:29 +01:00
|
|
|
|
Fullscreen = true;
|
2017-02-27 15:15:50 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|