本文整理匯總了C#中System.Windows.Forms.DataGridView.ProcessDialogKey方法的典型用法代碼示例。如果您正苦於以下問題:C# DataGridView.ProcessDialogKey方法的具體用法?C# DataGridView.ProcessDialogKey怎麽用?C# DataGridView.ProcessDialogKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.DataGridView
的用法示例。
在下文中一共展示了DataGridView.ProcessDialogKey方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ProcessDialogKey
public class CustomDataGridView : DataGridView
{
[System.Security.Permissions.UIPermission(
System.Security.Permissions.SecurityAction.LinkDemand,
Window = System.Security.Permissions.UIPermissionWindow.AllWindows)]
protected override bool ProcessDialogKey(Keys keyData)
{
// Extract the key code from the key value.
Keys key = (keyData & Keys.KeyCode);
// Handle the ENTER key as if it were a RIGHT ARROW key.
if (key == Keys.Enter)
{
return this.ProcessRightKey(keyData);
}
return base.ProcessDialogKey(keyData);
}
[System.Security.Permissions.SecurityPermission(
System.Security.Permissions.SecurityAction.LinkDemand, Flags =
System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
protected override bool ProcessDataGridViewKey(KeyEventArgs e)
{
// Handle the ENTER key as if it were a RIGHT ARROW key.
if (e.KeyCode == Keys.Enter)
{
return this.ProcessRightKey(e.KeyData);
}
return base.ProcessDataGridViewKey(e);
}
}