3
Reply

putting data with A+ctri key.

Zeb Muhammad

Zeb Muhammad

Aug 30 2017 1:31 AM
190
Dear Friends, please check my code, I want to update data with pressing A+ctrl ... but it does not work? code is below...
  1. protected override void OnKeyDown(KeyEventArgs e)  
  2. {  
  3. base.OnKeyDown(e);  
  4. if(e.KeyCode==Keys.A && e.Control)  
  5. {  
  6. try  
  7. {  
  8. scb = new SqlCommandBuilder(da);  
  9. da.Update(dt);  
  10. MessageBox.Show("Recode updated""Update", MessageBoxButtons.OK, MessageBoxIcon.Information);  
  11. Form2 f1 = new Form2();  
  12. f1.Show(); //this.Close();  
  13. }  
  14. catch (Exception ex)  
  15. {  
  16. MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);  
  17. }  
  18. }  
  19. }  

Answers (3)