|
|
|
@@ -1,4 +1,5 @@ |
|
|
|
using MaiMuAOI.SysCtrl;
|
|
|
|
using HZH_Controls.Controls;
|
|
|
|
using MaiMuAOI.SysCtrl;
|
|
|
|
using Microsoft.Office.Interop.Excel;
|
|
|
|
using Models;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
@@ -9,6 +10,7 @@ using System.ComponentModel; |
|
|
|
using System.Data;
|
|
|
|
using System.Drawing;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Reflection;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
@@ -24,10 +26,20 @@ namespace MaiMuAOI.SysUI.ProductAndStep |
|
|
|
|
|
|
|
public ProductListFrm(bool isProductRevise = false)
|
|
|
|
{
|
|
|
|
//设置窗体的双缓冲
|
|
|
|
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
|
|
|
|
this.UpdateStyles();
|
|
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
UIStyle.SetUIStyle(this);
|
|
|
|
this.uiTitel1.FatherForm = this;
|
|
|
|
|
|
|
|
//利用反射设置DataGridView的双缓冲
|
|
|
|
Type dgvType = this.dataGridView1.GetType();
|
|
|
|
PropertyInfo pi = dgvType.GetProperty("DoubleBuffered",
|
|
|
|
BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
|
pi.SetValue(this.dataGridView1, true, null);
|
|
|
|
|
|
|
|
this.tsbtnAdd.Enabled = this.tsbtnDel.Enabled = this.tsbtnSetting.Enabled = !isProductRevise;
|
|
|
|
this.tsbtnRevise.Visible = isProductRevise;
|
|
|
|
if (isProductRevise)
|
|
|
|
@@ -42,7 +54,7 @@ namespace MaiMuAOI.SysUI.ProductAndStep |
|
|
|
//显示行号与列宽度自动调整
|
|
|
|
dataGridView1.RowHeadersVisible = true;
|
|
|
|
dataGridView1.RowHeadersWidth = 50;
|
|
|
|
dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;//数据量过百绑定太变
|
|
|
|
dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;//DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;//数据量过百绑定太变
|
|
|
|
dataGridView1.RowPostPaint += (sender, e) =>//序号列头
|
|
|
|
{
|
|
|
|
SysMgr.showRowNum_onDataGrid_RowPostPaint(this.dataGridView1, sender, e);
|
|
|
|
@@ -53,6 +65,9 @@ namespace MaiMuAOI.SysUI.ProductAndStep |
|
|
|
|
|
|
|
//行列交叉处标题
|
|
|
|
//if (dataGridView1.RowHeadersVisible) dataGridView1.TopLeftHeaderCell.Value = "SPH/CYL";
|
|
|
|
|
|
|
|
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
|
|
|
|
dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
this.tbSearch.Top = toolStrip1.Top + 15;
|
|
|
|
@@ -67,7 +82,11 @@ namespace MaiMuAOI.SysUI.ProductAndStep |
|
|
|
if (selIndex > 0) liIndex = selIndex;
|
|
|
|
else if (this.dataGridView1.CurrentRow != null)
|
|
|
|
liIndex = this.dataGridView1.CurrentRow.Index;
|
|
|
|
dataGridView1.DataSource = new BindingSource(list, null);
|
|
|
|
|
|
|
|
BindingSource bs = new BindingSource();
|
|
|
|
bs.DataSource = list;
|
|
|
|
dataGridView1.DataSource = list;
|
|
|
|
//dataGridView1.DataSource = new BindingSource(list, null);
|
|
|
|
if (dataGridView1.Rows.Count > liIndex)
|
|
|
|
dataGridView1.CurrentCell = dataGridView1[1, liIndex];
|
|
|
|
//如果产品存在设置问题,如无图纸,无流程显示颜色
|
|
|
|
|