我正在嘗試找到一種解決方案來復制當您專注于特定 TextBox 或 MaskedTextBox 時選項卡的作用,我已經通過 VS 中的屬性按順序設定了 TabIndexs
FormaNalaza 是一種形式
private void FormaNalaza_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
//Switch to the next TabIndex Entity
}
}
這是我的解決方案,但我不知道如何將焦點更改為表單中的下一個物體
我試過SelectNextControl(*The starting Entity*, 1, 0, 0, 0)
編輯

輸出:

將其添加到事件中:

uj5u.com熱心網友回復:
The tab key does this automatically, so if you are ok with pressing tab instead of enter, you can do that. Changing the TabIndex property of your entities will change the order in which tab will switch between them.
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/421527.html
標籤:
