Merge pull request #873 from ranjanjharavi/fix-820-ShortcutKey-Show-Wrong-focus

Enable focus on the item count box
This commit is contained in:
Nick Vella 2019-10-14 12:41:25 +11:00 committed by GitHub
commit 75bdea0a97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -73,6 +73,9 @@ namespace OpenLiveWriter.PostEditor.OpenPost
textBoxFilter.KeyDown += new KeyEventHandler(textBoxFilter_KeyDown);
textBoxFilter.EnabledChanged += new EventHandler(textBoxFilter_EnabledChanged);
KeyPreview = true;
KeyDown += new KeyEventHandler(openPostForm_KeyDown);
filterPictureBox.Image = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.Search.png");
filterPictureBox.BackColor = SystemColors.Window;
filterPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
@ -81,6 +84,16 @@ namespace OpenLiveWriter.PostEditor.OpenPost
comboBoxPosts.AccessibleName = Res.Get(StringId.PostCountAccessible);
}
void openPostForm_KeyDown(object sender, KeyEventArgs e)
{
if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt && e.KeyCode == Keys.S)
{
ActiveControl = comboBoxPosts;
comboBoxPosts.DroppedDown = true;
e.SuppressKeyPress = true;
}
}
void textBoxFilter_EnabledChanged(object sender, EventArgs e)
{
filterPictureBox.BackColor = textBoxFilter.Enabled ? SystemColors.Window : SystemColors.Control;