|
|
@@ -14,6 +14,7 @@ using System.Threading;
|
|
|
using System.IO;
|
|
|
using System.IO.Ports;
|
|
|
using UAS_LabelMachine.CustomControl;
|
|
|
+using System.Reflection;
|
|
|
|
|
|
namespace UAS_LabelMachine
|
|
|
{
|
|
|
@@ -114,7 +115,14 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
public UAS_出货标签打印(string Master)
|
|
|
{
|
|
|
+ //设置窗体的双缓冲
|
|
|
+ this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
|
|
|
+ this.UpdateStyles();
|
|
|
InitializeComponent();
|
|
|
+ //利用反射设置DataGridView的双缓冲
|
|
|
+ Type dgvType = this.LabelInf.GetType();
|
|
|
+ PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
+ pi.SetValue(this.LabelInf, true, null);
|
|
|
Text = Text + "-" + Master;
|
|
|
}
|
|
|
|