示例#1
0
 private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         row2          = dataGridView2.Rows[dataGridView2.SelectedCells[0].RowIndex];
         row2.Selected = true;
         if (e.ColumnIndex == 1)
         {
             if (tipImage == null)
             {
                 tipImage          = new TipImage(row2.Cells[1].Value.ToString());
                 tipImage.Location = new Point(Cursor.Position.X, Cursor.Position.Y);
                 tipImage.Show();
             }
             else
             {
                 tipImage.Close();
                 tipImage          = new TipImage(row2.Cells[1].Value.ToString());
                 tipImage.Location = new Point(Cursor.Position.X, Cursor.Position.Y);
                 tipImage.Show();
             }
         }
         else
         {
             if (tipImage != null)
             {
                 tipImage.Hide();
             }
         }
     }
     catch
     {
         // MessageBox.Show(ex.Message);
     }
 }
示例#2
0
 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
     {
         //   MessageBox.Show(ex.Message);
     }
 }