-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCellButton.cs
More file actions
52 lines (42 loc) · 1.2 KB
/
CellButton.cs
File metadata and controls
52 lines (42 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Minesweeper
{
public partial class CellButton : Button
{
private int mRow;
private int mCol;
//private int mVal;
public int Row { get { return mRow; } }
public int Col { get { return mCol; } }
//public int Value
//{
// get { return mVal; }
// set { mVal = value; }
//}
public CellButton()
{
InitializeComponent();
}
public CellButton(int row, int col)
{
mRow = row;
mCol = col;
Font = new Font("Arial", 12, FontStyle.Bold);
Dock = DockStyle.Fill;
FlatStyle = FlatStyle.Flat;
BackgroundImageLayout = ImageLayout.Stretch;
EnabledChanged += CellButton_EnabledChanged;
CellButton_EnabledChanged(null, null);
}
private void CellButton_EnabledChanged(object sender, EventArgs e)
{
BackColor = (Enabled) ? Color.LightGray : Color.DarkGray;
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}
}
}