From 4811afb52c511565d2b13f36ed645243c7557803 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 2 Sep 2020 11:08:17 +0200 Subject: board generation --- MainForm.cs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 MainForm.cs (limited to 'MainForm.cs') diff --git a/MainForm.cs b/MainForm.cs new file mode 100644 index 0000000..08e2803 --- /dev/null +++ b/MainForm.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Chess +{ + public partial class MainForm : Form + { + private ChessBoard board; + + public MainForm() + { + InitializeComponent(); + } + + private void FitBoardContainerToScreen() + { + this.chessBoardBitmap.Location = new Point(0, 0); + this.chessBoardBitmap.Size = new Size(this.ClientSize.Width, this.ClientSize.Height); + } + + private void MainForm_Load(object sender, EventArgs e) + { + FitBoardContainerToScreen(); + this.board = new ChessBoard(this.chessBoardBitmap); + } + + private void MainForm_Resize(object sender, EventArgs e) + { + FitBoardContainerToScreen(); + this.board.HandleResize(); + } + } +} -- cgit v1.2.3-70-g09d2