private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { try { row1 = dataGridView1.Rows[dataGridView1.SelectedCells[0].RowIndex]; row1.Selected = true; txtCode.Text = row1.Cells["Code"].Value.ToString(); if (tipImage == null) { tipImage = new TipImage(row1.Cells[1].Value.ToString()); tipImage.Location = new Point(Cursor.Position.X, Cursor.Position.Y); tipImage.Show(); } else { tipImage.Close(); tipImage = new TipImage(row1.Cells[1].Value.ToString()); tipImage.Location = new Point(Cursor.Position.X, Cursor.Position.Y); tipImage.Show(); } } catch (Exception ex) { // MessageBox.Show(ex.Message); } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { try { DataRowView row1 = (DataRowView)(((GridView)dataGridView1.MainView).GetRow(((GridView)dataGridView1.MainView).GetSelectedRows()[0])); if (load) { if (tipImage == null) { tipImage = new TipImage(row1[1].ToString()); tipImage.Location = new Point(Cursor.Position.X, Cursor.Position.Y); tipImage.Show(); } else { tipImage.Close(); tipImage = new TipImage(row1[1].ToString()); tipImage.Location = new Point(Cursor.Position.X, Cursor.Position.Y); tipImage.Show(); } } } catch (Exception ex) { // MessageBox.Show(ex.Message); } }