summaryrefslogtreecommitdiff
path: root/MainForm.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MainForm.cs')
-rw-r--r--MainForm.cs40
1 files changed, 40 insertions, 0 deletions
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();
+ }
+ }
+}