在控件中怎么捕获?用DataGrid的KeyPress,不行,我试过

解决方案 »

  1.   

    seehttp://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q902q:)
      

  2.   

    http://expert.csdn.net/Expert/topic/1759/1759848.xml?temp=.1615259
      

  3.   

    You can override ProcessCmdKey, catch the Enter Key, and swap it for a Tab key by sending a Tab, and not processing the Enter Key. 
    public class MyDataGrid : DataGrid 
     
         { 
     
              protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) 
     
              { 
     
                   if(msg.WParam.ToInt32() == (int) Keys.Enter) 
     
                   { 
     
                        SendKeys.Send("{Tab}"); 
     
                        return true; 
     
                   } 
     
                   return base.ProcessCmdKey(ref msg, keyData); 
     
              } 
     
         } 
     from : http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q902q