sc 2 years ago
parent
commit
bd64153d83
  1. 21
      MainWindow.xaml.cs
  2. 4
      UserClass/DataGridHelper.cs

21
MainWindow.xaml.cs

@ -481,12 +481,12 @@ namespace formula_manage
{ {
if (e.Key == Key.Enter) if (e.Key == Key.Enter)
{ {
UserClass.PressKey.PressKeys(Keys.Right, false); PressKey.PressKeys(Keys.Right, false);
UserClass.PressKey.PressKeys(Keys.Right, true); PressKey.PressKeys(Keys.Right, true);
UserClass.PressKey.PressKeys(Keys.Up, false); PressKey.PressKeys(Keys.Up, false);
UserClass.PressKey.PressKeys(Keys.Up, true); PressKey.PressKeys(Keys.Up, true);
UserClass.PressKey.PressKeys(Keys.Tab, false); PressKey.PressKeys(Keys.Tab, false);
UserClass.PressKey.PressKeys(Keys.Tab, true); PressKey.PressKeys(Keys.Tab, true);
System.Windows.Controls.ComboBox curComboBox = sender as System.Windows.Controls.ComboBox; System.Windows.Controls.ComboBox curComboBox = sender as System.Windows.Controls.ComboBox;
curComboBox.SelectedIndex = 1; curComboBox.SelectedIndex = 1;
@ -501,14 +501,15 @@ namespace formula_manage
{ {
if (e.Key == Key.Enter) if (e.Key == Key.Enter)
{ {
UserClass.PressKey.PressKeys(Keys.Left, false); PressKey.PressKeys(Keys.Left, false);
UserClass.PressKey.PressKeys(Keys.Left, true); PressKey.PressKeys(Keys.Left, true);
UserClass.PressKey.PressKeys(Keys.Tab, false); PressKey.PressKeys(Keys.Tab, false);
UserClass.PressKey.PressKeys(Keys.Tab, true); PressKey.PressKeys(Keys.Tab, true);
} }
} }

4
UserClass/DataGridHelper.cs

@ -8,6 +8,10 @@ using System.Windows;
namespace formula_manage.UserClass namespace formula_manage.UserClass
{ {
/// <summary>
/// 实时更新datagrid
/// 调用示例:DataGridHelper.SetRealTimeCommit(Grid, true); Grid为对象控件名
/// </summary>
public static class DataGridHelper public static class DataGridHelper
{ {
public static void SetRealTimeCommit(DataGrid dataGrid, bool isRealTime) public static void SetRealTimeCommit(DataGrid dataGrid, bool isRealTime)

Loading…
Cancel
Save