Thursday 8 July, 2010

DISPLAY A TOOLTIP FOR A DATAGRID CELL

  1. private void dataGrid1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
  2. {
  3. try
  4. {
  5. DataGrid.HitTestInfo hti = dataGrid1.HitTest(e.X,e.Y);
  6. if(hti.Type == DataGrid.HitTestType.Cell)
  7. {
  8. toolTip1.SetToolTip(dataGrid1, dataGrid1[hti.Row, hti.Column].ToString());
  9. }
  10. }
  11. catch{}
  12. }

No comments:

Post a Comment