diff --git a/View/QueryView.xaml b/View/QueryView.xaml index ab35f46..f2c16ab 100644 --- a/View/QueryView.xaml +++ b/View/QueryView.xaml @@ -68,7 +68,10 @@ - + + + + diff --git a/View/StuffView.xaml b/View/StuffView.xaml index 473e682..3c66de1 100644 --- a/View/StuffView.xaml +++ b/View/StuffView.xaml @@ -81,7 +81,10 @@ - + + + + @@ -112,7 +115,7 @@ - + diff --git a/View/StuffView.xaml.cs b/View/StuffView.xaml.cs index 838cf22..cefbf2d 100644 --- a/View/StuffView.xaml.cs +++ b/View/StuffView.xaml.cs @@ -42,7 +42,7 @@ namespace Audit.View private void DataGridStuff_MouseDoubleClick(object sender, MouseButtonEventArgs e) { - int rownum = this.DataGridStuff.SelectedIndex;//获取鼠标选中行并定义变量 + int rownum = DataGridStuff.SelectedIndex;//获取鼠标选中行并定义变量 string DataGridStuff_ProductCode = (DataGridStuff.Columns[1].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第0列选中行单元格,原料代码 string DataGridStuff_ProductName = (DataGridStuff.Columns[2].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第1列选中行单元格,原料名称 string DataGridStuff_Price = (DataGridStuff.Columns[3].GetCellContent(DataGridStuff.Items[rownum]) as TextBlock).Text;//定位第2列选中行单元格,价格 @@ -63,15 +63,15 @@ namespace Audit.View if (DataGridStuff_ProductType.ToString() == "2") stuff_ProductType.Text = "粉体助剂"; } - private void stuff_Color_MouseDoubleClick(object sender, MouseButtonEventArgs e)//色彩框双击事件 + private void Stuff_Color_MouseDoubleClick(object sender, MouseButtonEventArgs e)//色彩框双击事件 { - System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();//打开调色盘页面 - if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();//使用调色盘控件ColorDialog + if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)//打开调色盘 { - - // System.Drawing.SolidBrush sb = new System.Drawing.SolidBrush(color); - // SolidColorBrush solidColorBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(sb.Color.A, sb.Color.R, sb.Color.G, sb.Color.B)); - // TextBox.stuff_Color.Background = solidColorBrush; + System.Drawing.Color DColor = colorDialog.Color;////获取选中色彩信息 + System.Windows.Media.Color MColor = new System.Windows.Media.Color();//转换 + MColor = System.Windows.Media.Color.FromArgb(DColor.A, DColor.R, DColor.G, DColor.B);//配置ARGB参数 + stuff_Color.Background = new SolidColorBrush(MColor);//ARGB参数输出至stuff_Color的背景色 } } }