private void Grid_PreviewKeyDown_1(object sender, KeyEventArgs e) { switch (e.Key) { case Key.F2: cmdAdd_Click(sender, e); break; case Key.F6: fChitietPhieu(); break; case Key.F7: if (pPhieuID == "") { Utils.showMessage("Bạn chưa chọn phiếu để in...", "Lưu ý"); } new MTReport().rptNX_Chanhxe(pPhieuID); break; case Key.F8: try { MTMain oMain = Application.Current.Windows.OfType <MTMain>().FirstOrDefault(); if (oMain != null) { oMain.onExitTab(); } } catch { } break; } }
private void cmdExit_Click(object sender, RoutedEventArgs e) { try { MTMain oMain = Application.Current.Windows.OfType <MTMain>().FirstOrDefault(); if (oMain != null) { oMain.onExitTab(); } } catch { } }
public static void fExit() { try { MTMain oMain = System.Windows.Application.Current.Windows.OfType <MTMain>().FirstOrDefault(); if (oMain != null) { oMain.onExitTab(); } } catch { } }