mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-05-09 12:51:54 -05:00
33 lines
913 B
C#
33 lines
913 B
C#
using System.ComponentModel;
|
|
using System.Windows.Forms;
|
|
|
|
namespace DSPRE {
|
|
public partial class InputComboBox : ComboBox {
|
|
public InputComboBox() {
|
|
DropDownStyle = ComboBoxStyle.DropDown;
|
|
|
|
AutoCompleteMode = AutoCompleteMode.SuggestAppend;
|
|
AutoCompleteSource = AutoCompleteSource.ListItems;
|
|
}
|
|
|
|
protected override void OnKeyDown(KeyEventArgs e) {
|
|
base.OnKeyDown(e);
|
|
|
|
if (e.KeyCode == Keys.Enter) {
|
|
string input = Text;
|
|
int index = FindStringExact(input.Trim());
|
|
if (index != -1) {
|
|
SelectedIndex = index;
|
|
}
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public new ComboBoxStyle DropDownStyle {
|
|
get { return base.DropDownStyle; }
|
|
set { base.DropDownStyle = ComboBoxStyle.DropDown; }
|
|
}
|
|
}
|
|
|
|
}
|