SilverlightフォームのEnterキーをtab key.iに変更するにはどうすればよいですか?winformsで次のコードを使用します。SilverlightフォームのTabキーにEnterキーを変更します。
/// <summary>
/// Change Enter key To Tab Key
/// </summary>
/// <param name="msg"></param>
/// <param name="keyData"></param>
/// <returns></returns>
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (msg.Msg == 256 && keyData == Keys.Enter)
{
// Execute an alternative action: here we tabulate in order to focus on the next control in the formular
if (ActiveControl.ToString().Contains("System.Windows.Forms.Button") ||
ActiveControl.ToString().Contains("DevComponents.DotNetBar.ButtonX"))
return base.ProcessCmdKey(ref msg, keyData);
SendKeys.Send("{TAB}");
// return true to stop any further interpretation of this key action
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
私はちょうどあなたが期待される結果は、コードが働いていた場合はお知らせ気軽に返す必要がありますどのようにお見せしたかった...以下の例では、コードのすべてを入れていなかった...で動作しません – MethodMan