private void txtSearch_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Down) { CityDataGrid.Focus(); } }
private void Sales_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.F8) { lblSearchPro.Text = ConfigApp.SEARCH_MODE_ID_MESSAGE; ModeIDPro = true; txtSearchPro.Focus(); } else if (e.KeyCode == Keys.F8) { lblMode.Text = ConfigApp.SEARCH_MODE_ID_MESSAGE; lblSearchCom.Text = ConfigApp.SEARCH_MODE_ID_MESSAGE; ModeID = true; txtSearch.Focus(); txtSearchCom.Focus(); } if (e.Control && e.KeyCode == Keys.F9) { lblSearchPro.Text = ConfigApp.SEARCH_MODE_TEXT_MESSAGE; ModeIDPro = false; txtSearchPro.Focus(); } else if (e.KeyCode == Keys.F9) { lblMode.Text = ConfigApp.SEARCH_MODE_TEXT_MESSAGE; lblSearchCom.Text = ConfigApp.SEARCH_MODE_TEXT_MESSAGE; ModeID = false; txtSearch.Focus(); txtSearchCom.Focus(); } if (e.Control && e.KeyCode == Keys.S) { } if (e.KeyCode == Keys.F12) { } if (e.Control && e.KeyCode == Keys.Down) { stockDataGrid.Focus(); cusDataGrid.Focus(); } if (e.Control && e.KeyCode == Keys.Up) { CityDataGrid.Focus(); ComDataGrid.Focus(); } if (e.Control && e.KeyCode == Keys.Right) { groupBox1.Focus();//foucs on payment method proDataGrid.Focus(); } if (e.Control && e.KeyCode == Keys.Left) { CityDataGrid.Focus(); ComDataGrid.Focus(); } }
private void OnLoaded(object sender, RoutedEventArgs e) { Loaded -= OnLoaded; if (!WafConfiguration.IsInDesignMode) { _cityCollectionView = CollectionViewSource.GetDefaultView(ViewModel.Items); _cityCollectionView.Filter = Filter; ViewModel.ItemCollectionView = _cityCollectionView.Cast <CityDataModel>(); CityDataGrid.Focus(); CityDataGrid.CurrentCell = new DataGridCellInfo(ViewModel.Items.FirstOrDefault(), CityDataGrid.Columns[0]); } }
private void CustomerModify_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F8) { lblMode.Text = ConfigApp.SEARCH_MODE_ID_MESSAGE; ModeID = true; txtSearch.Focus(); } if (e.KeyCode == Keys.F9) { lblMode.Text = ConfigApp.SEARCH_MODE_TEXT_MESSAGE; ModeID = false; txtSearch.Focus(); } if (e.Control && e.KeyCode == Keys.S) { updateRecord(); } if (e.KeyCode == Keys.F12) { txtCusName.Focus(); } if (e.Control && e.KeyCode == Keys.Down) { DataGrid.Focus(); } if (e.Control && e.KeyCode == Keys.Up) { CityDataGrid.Focus(); } if (e.Control && e.KeyCode == Keys.Right) { txtCusName.Focus(); } if (e.Control && e.KeyCode == Keys.Left) { CityDataGrid.Focus(); } }
public new void Focus() { CityDataGrid.Focus(); CityDataGrid.CurrentCell = new DataGridCellInfo(CityDataGrid.SelectedItem, CityDataGrid.Columns[0]); }