9
|
1 using System.Windows.Forms;
|
3
|
2
|
|
3 namespace ServerMonitorApp
|
|
4 {
|
9
|
5 /// <summary>Combo box containing options for size units.</summary>
|
3
|
6 class SizeUnitsComboBox : ComboBox
|
|
7 {
|
|
8 protected override void OnCreateControl()
|
|
9 {
|
|
10 base.OnCreateControl();
|
9
|
11 // Clear the items to prevent duplicates added at design time and run time.
|
3
|
12 Items.Clear();
|
|
13 Items.Add("B");
|
|
14 Items.Add("KB");
|
|
15 Items.Add("MB");
|
|
16 Items.Add("GB");
|
|
17 SelectedIndex = 0;
|
|
18 }
|
|
19 }
|
|
20
|
9
|
21 /// <summary>Size units.</summary>
|
3
|
22 public enum SizeUnits { B = 0, KB = 1, MB = 2, GB = 3 }
|
|
23 }
|