HamBook – Diff between revs 27 and 29
?pathlinks?
Rev 27 | Rev 29 | |||
---|---|---|---|---|
Line 13... | Line 13... | |||
13 | { |
13 | { |
|
14 | [DesignerCategory("ToolStrip"), |
14 | [DesignerCategory("ToolStrip"), |
|
15 | ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)] |
15 | ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)] |
|
16 | public class ScrollableToolStripComboBox : ToolStripComboBox |
16 | public class ScrollableToolStripComboBox : ToolStripComboBox |
|
17 | { |
17 | { |
|
18 | |
- | ||
19 | [Browsable(true), |
18 | [Browsable(true), |
|
20 | EditorBrowsable(EditorBrowsableState.Always), |
19 | EditorBrowsable(EditorBrowsableState.Always), |
|
21 | DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), |
20 | DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), |
|
22 | Description("Mouse scrolling")] |
21 | Description("Mouse scrolling")] |
|
23 | public event MouseEventHandler MouseWheel; |
22 | public event MouseEventHandler MouseWheel; |
|
Line 32... | Line 31... | |||
32 | Description("The image associated with the object.")] |
31 | Description("The image associated with the object.")] |
|
33 | public override Image Image { get => base.Image; set => base.Image = value; } |
32 | public override Image Image { get => base.Image; set => base.Image = value; } |
|
Line 34... | Line 33... | |||
34 | |
33 | |
|
Line 35... | Line -... | |||
35 | public new ComboBoxStyle DropDownStyle { get => base.DropDownStyle; set => base.DropDownStyle = value; } |
- | ||
36 | |
- | ||
37 | public object Value |
- | ||
38 | { |
- | ||
39 | get |
- | ||
40 | { |
- | ||
41 | if (Items.Count == 0) |
- | ||
42 | { |
- | ||
43 | return null; |
- | ||
44 | } |
- | ||
45 | |
- | ||
46 | return Items[0]; |
- | ||
47 | } |
- | ||
48 | set |
- | ||
49 | { |
- | ||
50 | |
- | ||
51 | if (value == null) |
- | ||
52 | { |
- | ||
53 | return; |
- | ||
54 | } |
- | ||
55 | |
- | ||
56 | switch (Items.Count) |
- | ||
57 | { |
- | ||
58 | case 0: |
- | ||
59 | Items.Add(value); |
- | ||
60 | break; |
- | ||
61 | default: |
- | ||
62 | Items[0] = value; |
- | ||
63 | break; |
- | ||
64 | } |
- | ||
65 | SelectedItem = Items[0]; |
- | ||
66 | } |
- | ||
67 | } |
34 | public new ComboBoxStyle DropDownStyle { get => base.DropDownStyle; set => base.DropDownStyle = value; } |
|
68 | |
35 | |
|
69 | public ScrollableToolStripComboBox() : base() |
36 | public ScrollableToolStripComboBox() : base() |
|
70 | { |
37 | { |