簡體   English   中英

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

[英]ProcessTabKey(true) 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);
        }

    }

您的代碼是正確的。 確保要選擇的所有控件的TabStop屬性都設置為true。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM