diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2020-09-02 11:08:17 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2020-09-02 11:08:17 +0200 |
| commit | 4811afb52c511565d2b13f36ed645243c7557803 (patch) | |
| tree | 3533dc4a8dfb5ed610033e0b9c527a535be6143b /MainForm.cs | |
board generation
Diffstat (limited to 'MainForm.cs')
| -rw-r--r-- | MainForm.cs | 40 |
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(); + } + } +} |
