added a KeyEventhandler to handle whenever ALT + S is pressed.

This commit is contained in:
Ravi Ranjan 2019-10-12 15:00:06 +05:30
parent 7f18b65c7a
commit cbb541a7be
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;