-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPictureChooser.cs
60 lines (50 loc) · 1.58 KB
/
PictureChooser.cs
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
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace NFL2K5Tool
{
/// <summary>
/// a control that has a string selection element and an expandable picture element.
/// </summary>
public partial class PictureChooser : StringSelectionControl
{
public event EventHandler PictureBoxClicked;
/// <summary>
/// A control that has a combobox and expandable picture box when entered.
/// </summary>
public PictureChooser()
{
InitializeComponent();
this.mPictureBox.Click += new EventHandler(mPictureBox_Click);
}
public Size ExpandedSize = new Size(126, 155);
public Size NormalSize = new System.Drawing.Size(126, 48);
/// <summary>
/// Called when picture box is clicked.
/// </summary>
protected virtual void OnPictureBoxClicked()
{
if (this.PictureBoxClicked != null)
this.PictureBoxClicked(this, EventArgs.Empty);
}
public PictureBox PictureBox { get { return this.mPictureBox; } }
protected override void OnEnter(EventArgs e)
{
this.Size = this.ExpandedSize;
base.OnEnter(e);
}
protected override void OnLeave(EventArgs e)
{
Size = NormalSize;
base.OnLeave(e);
}
void mPictureBox_Click(object sender, EventArgs e)
{
OnPictureBoxClicked();
}
}
}