Beispiel #1
0
        // Need these in case this search box takes focus
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            case Keys.Escape:
                Visible = false;
                return(true);

            case Keys.Tab:
                SelectItemRequest.Invoke(listBox.SelectedItem as string);
                return(true);

            case Keys.Enter:
                SelectItemRequest.Invoke(listBox.SelectedItem as string);
                return(true);
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }
Beispiel #2
0
 private void listBox_DoubleClick(object sender, EventArgs e)
 {
     SelectItemRequest.Invoke(listBox.SelectedItem as string);
 }