mirror of
https://github.com/kwsch/NHSE.git
synced 2026-07-19 08:41:32 -05:00
Remove dropdown on keypress
quality of life improvement
This commit is contained in:
parent
8e4e0a92f8
commit
e7e01ba007
3
NHSE.WinForms/Controls/ItemEditor.Designer.cs
generated
3
NHSE.WinForms/Controls/ItemEditor.Designer.cs
generated
|
|
@ -102,6 +102,7 @@ private void InitializeComponent()
|
|||
this.CB_ItemID.Size = new System.Drawing.Size(141, 21);
|
||||
this.CB_ItemID.TabIndex = 1;
|
||||
this.CB_ItemID.SelectedValueChanged += new System.EventHandler(this.CB_ItemID_SelectedValueChanged);
|
||||
this.CB_ItemID.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CB_KeyDown);
|
||||
//
|
||||
// NUD_Count
|
||||
//
|
||||
|
|
@ -237,6 +238,7 @@ private void InitializeComponent()
|
|||
this.CB_Recipe.TabIndex = 14;
|
||||
this.CB_Recipe.Visible = false;
|
||||
this.CB_Recipe.SelectedValueChanged += new System.EventHandler(this.CB_CountAlias_SelectedValueChanged);
|
||||
this.CB_Recipe.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CB_KeyDown);
|
||||
//
|
||||
// FLP_Controls
|
||||
//
|
||||
|
|
@ -270,6 +272,7 @@ private void InitializeComponent()
|
|||
this.CB_Fossil.TabIndex = 21;
|
||||
this.CB_Fossil.Visible = false;
|
||||
this.CB_Fossil.SelectedValueChanged += new System.EventHandler(this.CB_CountAlias_SelectedValueChanged);
|
||||
this.CB_Fossil.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CB_KeyDown);
|
||||
//
|
||||
// FLP_Count
|
||||
//
|
||||
|
|
|
|||
|
|
@ -220,5 +220,7 @@ private void L_WaterDays_Click(object sender, EventArgs e)
|
|||
foreach (var v in Watered)
|
||||
v.Checked = value;
|
||||
}
|
||||
|
||||
private void CB_KeyDown(object sender, KeyEventArgs e) => WinFormsUtil.RemoveDropCB(sender, e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,5 +66,7 @@ internal static DialogResult Prompt(MessageBoxButtons btn, params string[] lines
|
|||
internal static int GetIndex(ListControl cb) => (int)(cb?.SelectedValue ?? 0);
|
||||
|
||||
public static T? FirstFormOfType<T>() where T : Form => (T?)Application.OpenForms.Cast<Form>().FirstOrDefault(form => form is T);
|
||||
|
||||
public static void RemoveDropCB(object sender, KeyEventArgs e) => ((ComboBox)sender).DroppedDown = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user