简体   繁体   English

在Windows窗体的keydown事件中,ProcessTabKey(true)在c#splitcontainer上不起作用

[英]ProcessTabKey(true) not working on c# splitcontainer at keydown event of windows form

i am trying to use ProcessTabKey() method not working on c# splitcontainer at keydown event of windows form 我试图在Windows窗体的keydown事件中在C#splitcontainer上无法使用ProcessTabKey()方法

    public Form1()
    {
        InitializeComponent();
    }
    private void Form1_Load(object sender, EventArgs e)
    {
        this.BringToFront();
        this.Focus();
        this.KeyPreview = true;
    }
    private void Form1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Enter)
        {

                e.Handled = true;
                this.ProcessTabKey(true);
        }

    }

Your code is correct. 您的代码是正确的。 Ensure that all the controls you want to select have their TabStop property set to true. 确保要选择的所有控件的TabStop属性都设置为true。

Use SendKeys.send("{tab}"); 使用SendKeys.send(“ {tab}”); instead of this.ProcessTabKey(true); 而不是this.ProcessTabKey(true);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM