Esempio n. 1
0
        private void ButtonExpand_MouseDown(object sender, MouseButtonEventArgs e)
        {
            //RowStatusStrip.Height = RowStatusStrip.ActualHeight >= 151 ? new GridLength(22) : new GridLength(151);
            //var listBox = ExtendedStatusStripMain.ListBoxStatus;
            //listBox.ScrollIntoView(listBox.Items[listBox.Items.Count-1]);

            FlyoutStatus.IsOpen           = !FlyoutStatus.IsOpen;
            FlyoutStatus.IsHitTestVisible = FlyoutStatus.IsOpen;
            var theme = ThemeManager.DetectAppStyle(Application.Current);

            ListBoxStatus.BorderBrush = (Brush)theme.Item2.Resources["AccentColorBrush"];
            MenuMain.Focus();
        }
Esempio n. 2
0
 private void ButtonError_MouseDown(object sender, MouseButtonEventArgs e)
 {
     MenuMain.Focus();
 }
Esempio n. 3
0
 /// <summary>
 /// При вводе кода регистра в textbox   дабавляем артикул в  DataGrid
 /// </summary>
 private void Grid_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (txtRegistrInput.Text != string.Empty)    // валидация textboxa
         {
             if (IsNum(txtRegistrInput.Text))         // валидация textboxa
             {
                 if ((bool)chcFromDocument.IsChecked) // если  check загрузка из документа
                 {
                     // AddNewRowDataGrid(sender, e);
                 }
                 else
                 {
                     if ((bool)chcAutoPrint.IsChecked) // если check автопечать
                     {
                         AddNewRowsInDB();
                         SelectAllPriceList();
                         UpdateCountInDB();
                         PrintAllPriceList();
                     }
                     else
                     {
                         AddNewRowsInDB();
                         SelectAllPriceList();
                     }
                 }
             }
             else
             {
                 MessageBoxResult result = MessageBox.Show(" Не правильно введен код регистра или штрихкод !!! ", "Ошибка ", MessageBoxButton.OK, MessageBoxImage.Warning);
             }
         }
         else
         {
             MessageBoxResult result = MessageBox.Show(" Введите код регистра или штрихкод !!! ", "Ошибка ", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
         txtRegistrInput.Clear();
     }
     if (e.Key == Key.Delete)
     {
         Item item = dgMain.SelectedItem as Item;
         if (item != null)
         {
             DeleteRowFromDB(item.GuiId.ToString());
         }
     }
     if (e.Key == Key.F1) // инструкция
     {
         Instructions instr = new Instructions();
         instr.ShowDialog();
     }
     if (e.Key == Key.F2 && e.KeyboardDevice.Modifiers == ModifierKeys.Control) // Ctr + F2  фокус на textbox
     {
         txtRegistrInput.Focus();
     }
     if (e.Key == Key.F4) // фокус на редактирование в  datagrid
     {
         if (Items.Count > 0)
         {
             dgMain.CurrentCell = new DataGridCellInfo(dgMain.Items[0], dgMain.Columns[2]);
             dgMain.BeginEdit();
         }
     }
     if (e.Key == Key.P && e.KeyboardDevice.Modifiers == ModifierKeys.Control) // Ctr + P печатаем
     {
         txtRegistrInput.Focus();
         btnPrint_Click(sender, e);
     }
     if (e.Key == Key.A && e.KeyboardDevice.Modifiers == ModifierKeys.Control) // Ctr + A снять/ поставить флажек  автопечать
     {
         if ((bool)chcAutoPrint.IsChecked)
         {
             chcAutoPrint.IsChecked = false;
         }
         else
         {
             chcAutoPrint.IsChecked = true;
         }
     }
     if (e.Key == Key.F6) // снять/ поставить флажек загрузить из документа
     {
         if ((bool)chcFromDocument.IsChecked)
         {
             chcFromDocument.IsChecked = false;
         }
         else
         {
             chcFromDocument.IsChecked = true;
         }
     }
     if (e.Key == Key.F7) // фокус на  главное меню
     {
         MenuMain.Focus();
     }
 }