Files
Sharpy_Picross/NonoGramme/Form1.cs
T

46 lines
1.0 KiB
C#

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 NonoGramme
{
public partial class Form1 : Form
{
const int UI_BORDER = 30;
public Form1()
{
InitializeComponent();
nonogramme1.NewGame(new Size(5,5));
}
private void Form1_Load(object sender, EventArgs e)
{
ScaleUi();
}
private void Form1_Resize(object sender, EventArgs e)
{
ScaleUi();
}
private void ScaleUi()
{
if (ClientSize.Width > ClientSize.Height)
{
nonogramme1.Size = new Size(ClientSize.Height, ClientSize.Height - UI_BORDER);
}
else
{
nonogramme1.Size = new Size(ClientSize.Width - UI_BORDER, ClientSize.Width);
}
nonogramme1.Refresh();
}
}
}