Ejemplo n.º 1
0
    protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
    {
        if (e.KeyCode == Keys.Tab)
        {
            e.IsInputKey = true;

            string cur = auto_complete(Text);
            if (cur.Equals(Text) == false)
            {
                Text = cur;
                this.Select(Text.Length, 0);
            }
            return;
        }
        base.OnPreviewKeyDown(e);
    }
 private void valueComboBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     resetMethods();
 }
Ejemplo n.º 3
0
 private void XeComPuter_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 4
0
 private void AtrybutyForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 5
0
 private void Unit_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     // MessageBox.Show(e.KeyCode.ToString());
 }
Ejemplo n.º 6
0
 private void Panel_Picture_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
 {
     e.IsInputKey = true;
 }
Ejemplo n.º 8
0
 private void notionalEntry_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
        protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Prior:
            case Keys.Next:
                HandlePageKeys(e.KeyCode);
                e.IsInputKey = true;
                return;

            case Keys.End:
            case Keys.Home:
                if (fVirtualMode)
                {
                    ScrollEndVirtual(e.KeyCode == Keys.Home);
                }
                goto Label_014F;

            case Keys.Right:
                if (!(OwnerItem is ToolStripDropDownButton))
                {
                    foreach (ToolStripItem item in Items)
                    {
                        if (item.Selected)
                        {
                            if ((item is ToolStripMenuItem) && !((ToolStripMenuItem)item).HasDropDownItems)
                            {
                                e.IsInputKey = true;
                            }
                            break;
                        }
                    }
                }
                goto Label_014F;

            case Keys.Return:
                if (!fCancelClosingAncestors)
                {
                    foreach (ToolStripItem item2 in Items)
                    {
                        if (item2.Selected)
                        {
                            QMenuItem item3 = item2 as QMenuItem;
                            if ((item3 != null) && item3.HasDropDownItems)
                            {
                                e.IsInputKey = true;
                                item2.PerformClick();
                            }
                            break;
                        }
                    }
                    goto Label_014F;
                }
                e.IsInputKey = true;
                break;

            default:
                goto Label_014F;
            }
            return;

Label_014F:
            base.OnPreviewKeyDown(e);
        }
Ejemplo n.º 10
0
 private void OnFieldPreviewKeyDown(Object sender, PreviewKeyDownEventArgs e)
 {
     OnPreviewKeyDown(e);
 }
Ejemplo n.º 11
0
        private void FormScreen_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            string strTemp = "";

            try
            {
                //strTemp = labelPinyin.Text + (char)e.KeyCode;
                //if (strTemp.Contains(" 0") || strTemp.Contains(" -") || strTemp.Contains("||") || strTemp.Contains("::"))
                //{
                //    return;
                //}

                switch (e.KeyCode)
                {
                case Keys.F5:

                    //ShowScreen();

                    //if (this.FormBorderStyle == FormBorderStyle.None)
                    //{
                    //    this.FormBorderStyle = FormBorderStyle.Sizable;
                    //    this.WindowState = FormWindowState.Normal;
                    //}
                    //else
                    //{
                    if (this.FormBorderStyle == FormBorderStyle.None && this.WindowState == FormWindowState.Maximized)
                    {
                    }
                    else
                    {
                        this.FormBorderStyle = FormBorderStyle.None;
                        this.WindowState     = FormWindowState.Maximized;
                    }

                    this.ScrollScreenTo(0);
                    this.Invalidate(true);


                    //}

                    //this.panelLectionPannelBack.Controls.Remove(this.panelLectionContent);
                    //this.Controls.Add(this.panelLectionContent);
                    //this.panelLectionContent.BringToFront();
                    //this.FormBorderStyle = FormBorderStyle.None;
                    //this.WindowState = FormWindowState.Maximized;

                    //this.richTextBoxLectionContent.Top = 0;

                    ////重新计算高度
                    //ReCalculateHeight();
                    break;

                case Keys.Escape:

                    if (panelPinyin.Visible == true)
                    {
                        //清空拼音搜索字符串
                        _formControl.StrSearchByPinYin = "";

                        labelPinyin.Text = "";
                        listBoxPinyin.Items.Clear();
                        panelPinyin.SendToBack();
                        panelPinyin.Visible = false;

                        //this.panelLectionContent.Focus();
                    }
                    else
                    {
                        //this.FormBorderStyle = FormBorderStyle.Sizable;
                        //this.WindowState = FormWindowState.Normal;
                        //this.Controls.Remove(this.panelLectionContent);
                        //this.panelLectionPannelBack.Controls.Add(this.panelLectionContent);
                        //this.panelLectionContent.Dock = DockStyle.Fill;

                        //this.richTextBoxLectionContent.Top = 0;

                        if (this.FormBorderStyle == FormBorderStyle.Sizable && this.WindowState == FormWindowState.Normal)
                        {
                        }
                        else
                        {
                            this.FormBorderStyle = FormBorderStyle.Sizable;
                            this.WindowState     = FormWindowState.Normal;
                        }

                        this.ScrollScreenTo(0);
                        this.Invalidate(true);
                    }
                    ////重新计算高度
                    //ReCalculateHeight();
                    break;

                case Keys.Up:
                    this.ScrollScreen(50);
                    break;

                case Keys.Down:
                    this.ScrollScreen(-50);
                    break;

                case Keys.Home:
                    this.ScrollScreenTo(0);
                    this.Invalidate(true);

                    //_iScrollIndex = 0;
                    //this.Invalidate(true);
                    //this.richTextBoxLectionContent.Top = 0;
                    break;

                case Keys.PageDown:
                    if (_formControl.listViewLectionList.Items.Count <= 0)
                    {
                        return;
                    }

                    if (_formControl.listViewLectionList.Items.Count > 0 && _formControl.listViewLectionList.SelectedItems.Count == 0)     //判断有没有选择项
                    {
                        _formControl.listViewLectionList.Items[0].Selected = true;
                    }

                    //计算选择项的位置
                    int iPageDownIndex = _formControl.listViewLectionList.SelectedItems[0].Index + 1 >= _formControl.listViewLectionList.Items.Count ? _formControl.listViewLectionList.SelectedItems[0].Index : _formControl.listViewLectionList.SelectedItems[0].Index + 1;
                    _formControl.listViewLectionList.Items[iPageDownIndex].Selected = true;

                    break;

                case Keys.PageUp:
                    if (_formControl.listViewLectionList.Items.Count <= 0)
                    {
                        return;
                    }

                    if (_formControl.listViewLectionList.Items.Count > 0 && _formControl.listViewLectionList.SelectedItems.Count == 0)     //判断有没有选择项
                    {
                        _formControl.listViewLectionList.Items[0].Selected = true;
                    }

                    //计算选择项的位置
                    int iPageUpIndex = _formControl.listViewLectionList.SelectedItems[0].Index - 1 < 0 ? 0 : _formControl.listViewLectionList.SelectedItems[0].Index - 1;
                    _formControl.listViewLectionList.Items[iPageUpIndex].Selected = true;
                    break;

                case Keys.Enter:
                    //清空拼音搜索字符串
                    _formControl.StrSearchByPinYin = "";

                    //添加经文到列表
                    if (this.labelPinyin.Text != "" && this.labelPinyin.Text.Contains(":") &&
                        !this.labelPinyin.Text.EndsWith(":") && !this.labelPinyin.Text.EndsWith("-"))
                    {
                        _formControl.listViewLectionList.Items.Add(new ListViewItem(
                                                                       new string[] { (_formControl.listViewLectionList.Items.Count + 1).ToString(),
                                                                                      this.labelPinyin.Text }));
                    }

                    labelPinyin.Text = "";
                    listBoxPinyin.Items.Clear();
                    panelPinyin.SendToBack();
                    panelPinyin.Visible = false;

                    //this.panelLectionContent.Focus();

                    break;

                case Keys.Back:
                    //如果拼音中有值
                    if (_formControl.StrSearchByPinYin.Length > 0)
                    {
                        //如果控件中有值,并且不以空格结尾
                        if (labelPinyin.Text != "" && !labelPinyin.Text.EndsWith(" "))
                        {
                            labelPinyin.Text = labelPinyin.Text.Remove(labelPinyin.Text.Length - 1);

                            if (labelPinyin.Text.Contains(":") && !labelPinyin.Text.EndsWith(":") && !labelPinyin.Text.EndsWith("-"))
                            {
                                ShowLectionByVolumeNameEtc(labelPinyin.Text, false);
                            }
                        }
                        else
                        {
                            _formControl.StrSearchByPinYin = _formControl.StrSearchByPinYin.Remove(_formControl.StrSearchByPinYin.Length - 1);
                            if (_formControl.StrSearchByPinYin.Length > 0)
                            {
                                ShowVolumeNameByPinYin();
                            }
                            else
                            {
                                labelPinyin.Text = "";
                                panelPinyin.SendToBack();
                                panelPinyin.Visible = false;

                                _formControl.StrSearchByPinYin = "";
                            }
                        }
                    }
                    //else
                    //{
                    //    //如果拼音中没有值


                    //}

                    break;

                case Keys.Oem1:
                    ////_formControl.StrSearchByPinYin += ":";
                    if (labelPinyin.Text.Contains(":"))
                    {
                        return;
                    }

                    strTemp = "";
                    strTemp = labelPinyin.Text + ":";

                    if (!strTemp.Contains("::") && !strTemp.Contains("--") && !strTemp.Contains(":-") && !strTemp.Contains(" 0") && !strTemp.Contains(" -"))
                    {
                        labelPinyin.Text += ":";
                    }

                    break;

                case Keys.OemMinus:
                    if (labelPinyin.Text.Contains("-"))
                    {
                        return;
                    }

                    //_formControl.StrSearchByPinYin += "-";
                    strTemp = "";
                    strTemp = labelPinyin.Text + "-";

                    if (strTemp.Contains(":") && !strTemp.Contains(":-") && !strTemp.Contains("-:") && !strTemp.Contains("--") && !strTemp.EndsWith(":") && !strTemp.Contains("--") && !strTemp.Contains(" 0") && !strTemp.Contains(" -"))
                    {
                        labelPinyin.Text += "-";
                    }

                    break;

                default:
                    //拼音查询功能

                    //_formControl.StrSearchByPinYin += e.KeyCode.ToString();
                    //_formControl.StrSearchByPinYin = _formControl.StrSearchByPinYin.ToLower();

                    //if (_formControl.StrSearchByPinYin.Length > 0)
                    //{
                    //    ShowVolumeNameByPinYin();
                    //    return;
                    //}

                    int iKey = e.KeyValue;

                    switch (iKey)
                    {
                    //数字0 - 9
                    case 48:
                    case 49:
                    case 50:
                    case 51:
                    case 52:
                    case 53:
                    case 54:
                    case 55:
                    case 56:
                    case 57:
                        //case 32:
                        //case 45:
                        //case 58:
                        //case 186:
                        //case 189:
                        //如果labelPinyin中有经卷名称,则根据数字显示章节
                        //MessageBox.Show(e.KeyChar.ToString());
                        if (labelPinyin.Text != "")
                        {
                            strTemp = "";
                            strTemp = labelPinyin.Text + (char)e.KeyValue;

                            if (strTemp.Contains(" 0") || strTemp.Contains(" -") || strTemp.Contains("||") || strTemp.Contains("::"))
                            {
                                break;
                            }

                            if (strTemp.Contains(":") && !strTemp.EndsWith(":") && !strTemp.EndsWith("-"))
                            {
                                //验证是否为有效的拼音和章节
                                if (ValidatePinYin(strTemp))
                                {
                                    labelPinyin.Text += (char)e.KeyValue;

                                    //if (labelPinyin.Text.Contains(":") && !labelPinyin.Text.EndsWith(":") && !labelPinyin.Text.EndsWith("-"))
                                    //{
                                    ShowLectionByVolumeNameEtc(labelPinyin.Text, false);
                                    //}
                                }
                                else
                                {
                                    break;
                                }
                            }
                            else
                            {
                                labelPinyin.Text += (char)e.KeyValue;
                            }
                        }
                        else
                        {
                            return;
                        }
                        //如果labelPinyin中没有经卷名称,则无操作

                        break;

                    case 13:


                        break;

                    default:
                        //a --- z 之间
                        if (65 <= e.KeyValue && e.KeyValue <= 90)
                        {
                            _formControl.StrSearchByPinYin += e.KeyCode.ToString();
                            ShowVolumeNameByPinYin();
                        }

                        break;
                    }

                    break;
                }

                //this.panelLectionContent.Focus();
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 12
0
 private void Unit_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 13
0
 private void CmdWindow_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 14
0
 private void TbxEvent_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     Write("PreviewKeyDown");
 }
Ejemplo n.º 15
0
 private void radGridView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 16
0
 private void btnRight_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     TwoZeroFourEightView_PreviewKeyDown(sender, e);
 }
Ejemplo n.º 17
0
 private void Form1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 18
0
 private void txtboxUsuario_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 19
0
 private void ZwrotEditForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 20
0
 public virtual void PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 21
0
 private void ByteDataPanel_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     e.IsInputKey = inputKeyBehavior.ContainsKey(e.KeyCode);
 }
Ejemplo n.º 22
0
 public override bool HandlePreviewKeyDown(PreviewKeyDownEventArgs e)
 {
     return(true);
 }
Ejemplo n.º 23
0
 private void txtPrincipal_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     FormControlMethods.FixTextBoxCursor((TextBox)sender, e);
 }
Ejemplo n.º 24
0
 private void textBoxPort_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 25
0
        }    //

        private void viendoEdicion(object sender, PreviewKeyDownEventArgs e)
        {
            this.teclaEnter = e.KeyCode == Keys.Enter;
        }
Ejemplo n.º 26
0
 private void pictureBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 27
0
 protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
 {
     OnKeyDown(this, e);
     base.OnPreviewKeyDown(e);
 }
Ejemplo n.º 28
0
 private void tempPictureBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 29
0
        /// <summary>
        /// MainExplorerのPreviewKeyDown
        /// NOTE:KeyDownイベントはハンドリングできない。(イベントが発火しない)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainExplorer_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            //Viライクな操作
            //if (e.KeyCode == Keys.J) {
            //    SendKeys.Send("{DOWN}");
            //    return;
            //}
            //if (e.KeyCode == Keys.K) {
            //    SendKeys.Send("{UP}");
            //    return;
            //}
            //if (e.KeyCode == Keys.L) {
            //    SendKeys.Send("{RIGHT}");
            //    return;
            //}
            //if (e.KeyCode == Keys.H) {
            //    SendKeys.Send("{LEFT}");
            //    return;
            //}
            //if (e.KeyCode == Keys.Oem1) {
            //    _command = ":";
            //    return;
            //}
            //if (e.KeyCode == Keys.W && _command == ":") {
            //    this.SubExplorer.PerformAutoScale();
            //    _command = "";
            //    return;
            //}
            if ((e.Modifiers & Keys.Alt) == Keys.Alt && e.KeyCode == Keys.Left)
            {
                this.MainExplorer.NavigateLogLocation(NavigationLogDirection.Backward);
                return;
            }
            if ((e.Modifiers & Keys.Alt) == Keys.Alt && e.KeyCode == Keys.D)
            {
                //アドレスバーへ
                this.MainExplorerCombo.Focus();
                this.MainExplorerCombo.SelectAll();
            }
            if (e.KeyCode == Keys.BrowserBack)
            {
                this.MainExplorer.NavigateLogLocation(NavigationLogDirection.Backward);
                return;
            }
            if (e.KeyCode == Keys.BrowserForward)
            {
                this.MainExplorer.NavigateLogLocation(NavigationLogDirection.Forward);
                return;
            }
            if (e.KeyCode == Keys.Back)
            {
                this.MainExplorer.NavigateLogLocation(NavigationLogDirection.Backward);
                return;
            }
            if ((e.Modifiers & Keys.Alt) == Keys.Alt && e.KeyCode == Keys.Right)
            {
                this.MainExplorer.NavigateLogLocation(NavigationLogDirection.Forward);
                return;
            }
            if ((e.Modifiers & Keys.Alt) == Keys.Alt && e.KeyCode == Keys.Up)
            {
                UpwardNavigation(this.MainExplorer);

                return;
            }

            if ((e.Modifiers & Keys.Control) == Keys.Control && e.KeyCode == Keys.W)
            {
                this.SubExplorer.Select();
                //this.SubExplorer.SelectedItems[0]..Add(this.SubExplorer.Items[0]);
                //this.SubExplorer.Items[0].Properties.System.
                //this.SubExplorer.Focus();
            }
            if ((e.Modifiers & Keys.Control) == Keys.Control && e.KeyCode == Keys.F)
            {
                ShowSearchForm(this.MainExplorerCombo.Text);
            }
            if ((e.Modifiers & Keys.Control) == Keys.Control && e.KeyCode == Keys.E)
            {
                OpenExplorerButton.PerformClick();
            }
            if ((e.Modifiers & Keys.Control) == Keys.Control && e.KeyCode == Keys.S)
            {
                ShowSearchForm();
            }
        }
Ejemplo n.º 30
0
 protected virtual void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
 {
 }
Ejemplo n.º 31
0
 private void WebBrowserControl_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     this.OnPreviewKeyDown(e);
 }
Ejemplo n.º 32
0
    public void OnPreviewKeyDown(object sender, PreviewKeyDownEventArgs ee)
    {
        // By default, certain key events are pre-processed by the Form,
        // before any contained Control gets that key event.
        // This occurs for (TAB, RETURN, ESC, UP ARROW, DOWN ARROW, LEFT ARROW, RIGHT ARROW),
        // which are of interest to us in our handling.
        //
        // We desire to handle key events in the form, thus this method is
        // an event handler for PreviewKeyDown which causes the key events
        // for those keys to be passed on to the form, by means of
        // setting e.IsInputKey = true for the wanted keys.
        //     http://msdn.microsoft.com/en-us/library/system.windows.forms.control.previewkeydown.aspx

        switch (ee.KeyCode) {
            case Keys.Tab:
            case Keys.Return:
            case Keys.Escape:
                ee.IsInputKey = true;
                break;

            case Keys.Up:
            case Keys.Down:
            case Keys.Left:
            case Keys.Right:
                ee.IsInputKey = true;
                break;
        }
    }
Ejemplo n.º 33
0
 private void AnimationForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     this.Close();
 }