Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
21eac08f7a
4 files changed
+39
-10
No files matched your search
@@ -155,5 +155,10 @@ namespace DyeingComputer
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void KeyBinding_Changed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// if(Next.Visibility == Visibility.Visible) container.Content = new WorkOrderView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
xmlns:local="clr-namespace:DyeingComputer.View"
|
xmlns:local="clr-namespace:DyeingComputer.View"
|
||||||
xmlns:lang="clr-namespace:DyeingComputer.Properties"
|
xmlns:lang="clr-namespace:DyeingComputer.Properties"
|
||||||
xmlns:localUserClass="clr-namespace:DyeingComputer.UserClass"
|
xmlns:localUserClass="clr-namespace:DyeingComputer.UserClass"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
||||||
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
||||||
<Grid>
|
<Grid>
|
||||||
<DataGrid x:Name="Grid" AlternationCount="2" Margin="0,0,0,0" d:ItemsSource="{d:SampleData ItemCount=99}" AutoGenerateColumns="False"
|
<DataGrid x:Name="Grid" AlternationCount="2" Margin="0,0,0,0" d:ItemsSource="{d:SampleData ItemCount=99}" AutoGenerateColumns="False"
|
||||||
@@ -14,8 +14,7 @@
|
|||||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
||||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||||
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column" InputMethod.IsInputMethodEnabled ="False"
|
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column" InputMethod.IsInputMethodEnabled ="False"
|
||||||
CellEditEnding="Grid_CellEditEnding"
|
CellEditEnding="Grid_CellEditEnding" Background="White" SelectionMode="Single" FontSize="15" Cursor="AppStarting" >
|
||||||
Background="White" SelectionMode="Single" FontSize="15" Cursor="AppStarting" >
|
|
||||||
<DataGrid.RowStyle >
|
<DataGrid.RowStyle >
|
||||||
<Style TargetType="{x:Type DataGridRow}">
|
<Style TargetType="{x:Type DataGridRow}">
|
||||||
<Setter Property="Height" Value="30" />
|
<Setter Property="Height" Value="30" />
|
||||||
|
|||||||
@@ -32,12 +32,6 @@ namespace DyeingComputer.View
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
set_sql();
|
set_sql();
|
||||||
|
|
||||||
|
|
||||||
//Grid.Focus();
|
|
||||||
Grid.SelectedIndex = 0;
|
|
||||||
// var row = Grid.ItemContainerGenerator.ContainerFromIndex(0) as FrameworkElement;
|
|
||||||
//if (row != null ) {row.Focus(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||||
@@ -76,5 +70,33 @@ namespace DyeingComputer.View
|
|||||||
SQLiteHelpers.Close();//关闭数据库
|
SQLiteHelpers.Close();//关闭数据库
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作
|
||||||
|
{
|
||||||
|
DataGridRow dr = (DataGridRow)Grid.ItemContainerGenerator.ContainerFromIndex(0);//取第0行单元格
|
||||||
|
DataGridCellsPresenter presenter = GetVisualChild<DataGridCellsPresenter>(dr);
|
||||||
|
DataGridCell cell = (DataGridCell)presenter.ItemContainerGenerator.ContainerFromIndex(3); //取第3列每行单元格
|
||||||
|
cell.Focus();
|
||||||
|
Grid.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
public static T GetVisualChild<T>(Visual parent) where T : Visual
|
||||||
|
{
|
||||||
|
T child = default(T);
|
||||||
|
int numVisuals = VisualTreeHelper.GetChildrenCount(parent);
|
||||||
|
for (int i = 0; i < numVisuals; i++)
|
||||||
|
{
|
||||||
|
Visual v = (Visual)VisualTreeHelper.GetChild(parent, i);
|
||||||
|
child = v as T;
|
||||||
|
if (child == null)
|
||||||
|
{
|
||||||
|
child = GetVisualChild<T>(v);
|
||||||
|
}
|
||||||
|
if (child != null)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return child;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,8 +34,11 @@ namespace DyeingComputer.Windows
|
|||||||
public ViewStep()
|
public ViewStep()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
this.DataContext = this;
|
||||||
Form1_Load();
|
Form1_Load();
|
||||||
FocusManager.SetFocusedElement(boxNAME, boxNAME);
|
// FocusManager.SetFocusedElement(boxNAME, boxNAME);
|
||||||
|
boxNAME.Focus();
|
||||||
|
|
||||||
P1.Visibility = Visibility.Collapsed;
|
P1.Visibility = Visibility.Collapsed;
|
||||||
P1N.Visibility = Visibility.Collapsed;
|
P1N.Visibility = Visibility.Collapsed;
|
||||||
P2.Visibility = Visibility.Collapsed;
|
P2.Visibility = Visibility.Collapsed;
|
||||||
|
|||||||
Reference in new issue
Block a user