Browse Source

修改相似颗粒搜索功能中选中触发条件为双击

cxs 4 tháng trước cách đây
mục cha
commit
fc8f57cd18

+ 3 - 3
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.Designer.cs

@@ -63,7 +63,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.dgV_SimilarParticles.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
             this.dgV_SimilarParticles.Size = new System.Drawing.Size(1772, 725);
             this.dgV_SimilarParticles.TabIndex = 6;
-            this.dgV_SimilarParticles.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgV_SimilarParticles_CellMouseClick);
+            this.dgV_SimilarParticles.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgV_SimilarParticles_CellMouseDoubleClick);
             this.dgV_SimilarParticles.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dgV_SimilarParticles_KeyUp);
             this.dgV_SimilarParticles.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgV_SimilarParticles_MouseUp);
             // 
@@ -72,7 +72,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.movetoparticleToolStripMenuItem});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(211, 48);
+            this.contextMenuStrip1.Size = new System.Drawing.Size(211, 26);
             // 
             // movetoparticleToolStripMenuItem
             // 
@@ -101,7 +101,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.btn_Cannnel.Name = "btn_Cannnel";
             this.btn_Cannnel.Size = new System.Drawing.Size(107, 33);
             this.btn_Cannnel.TabIndex = 8;
-            this.btn_Cannnel.Text = "Cannnel";
+            this.btn_Cannnel.Text = "Cancel";
             this.btn_Cannnel.UseVisualStyleBackColor = true;
             this.btn_Cannnel.Click += new System.EventHandler(this.btn_Cannnel_Click);
             // 

+ 23 - 23
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.cs

@@ -531,28 +531,6 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.Close();
         }
 
-        private void dgV_SimilarParticles_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
-        {
-            var SelectRows = dgV_SimilarParticles.SelectedRows;
-            if (SelectRows.Count != 0)
-            {
-                if (SelectRows.Count == 1)
-                {
-                    DataGridViewRow dgvr = SelectRows[0];
-
-                    if ((bool)dgvr.Cells[0].EditedFormattedValue == true)
-                    {
-                        dgvr.Cells[0].Value = false;
-                    }
-                    else
-                    {
-                        dgvr.Cells[0].Value = true;
-                    }
-                    dgV_SimilarParticles.Rows[0].Cells[0].Value = true;
-                }
-            }
-        }
-
         private void cBx_All_CheckedChanged(object sender, EventArgs e)
         {
             CheckBox selectAllCheckBox = (CheckBox)sender;
@@ -764,7 +742,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             }
             if (e.KeyData == Keys.Space)
             {
-                dgV_SimilarParticles_CellMouseClick(null,null);
+                dgV_SimilarParticles_CellMouseDoubleClick(null,null);
             }
         }
 
@@ -775,5 +753,27 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                 btn_Search_Click(null, null);
             }
         }
+
+        private void dgV_SimilarParticles_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
+        {
+            var SelectRows = dgV_SimilarParticles.SelectedRows;
+            if (SelectRows.Count != 0)
+            {
+                if (SelectRows.Count == 1)
+                {
+                    DataGridViewRow dgvr = SelectRows[0];
+
+                    if ((bool)dgvr.Cells[0].EditedFormattedValue == true)
+                    {
+                        dgvr.Cells[0].Value = false;
+                    }
+                    else
+                    {
+                        dgvr.Cells[0].Value = true;
+                    }
+                    dgV_SimilarParticles.Rows[0].Cells[0].Value = true;
+                }
+            }
+        }
     }
 }