Skip to content

Commit 816cdd1

Browse files
authored
Merge pull request #342 from valimaties/FixMaterialComboBoxIndexChanged
Fixed MaterialComboBox SelectedIndexChanged not refreshing and improvement.
2 parents f80741f + 746792f commit 816cdd1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

MaterialSkin/Controls/MaterialComboBox.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ public MaterialComboBox()
147147
MouseState = MouseState.OUT;
148148
Invalidate();
149149
};
150+
SelectedIndexChanged += (sender, args) =>
151+
{
152+
Invalidate();
153+
};
154+
KeyUp += (sender, args) =>
155+
{
156+
if (Enabled && DropDownStyle == ComboBoxStyle.DropDownList && (args.KeyCode == Keys.Delete || args.KeyCode == Keys.Back))
157+
{
158+
SelectedIndex = -1;
159+
Invalidate();
160+
}
161+
};
150162
}
151163

152164
protected override void OnPaint(PaintEventArgs pevent)

0 commit comments

Comments
 (0)