Beispiel #1
0
 private void RentEdit_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Close();
         try
         {
             RentView rentView = this.Owner as RentView;
             rentView.Close();
         }
         catch
         {
         }
         try
         {
             RentView    rentView   = this.Owner as RentView;
             RentsList   rList      = rentView.Owner as RentsList;
             ObjectView  objectView = rList.Owner as ObjectView;
             ObjectsList objList    = objectView.Owner as ObjectsList;
             rentView.Close();
             rList.Close();
             objectView.Close();
             objList.Close();
         }
         catch
         {
         }
     }
 }
 private void ObjectView_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Close();
         try
         {
             ObjectsList objList = this.Owner as ObjectsList;
             objList.Close();
         }
         catch
         {
         }
     }
 }