sauce31
Messages postés26Date d'inscriptionmardi 14 avril 2009StatutMembreDernière intervention 2 juin 2009
-
28 mai 2009 à 16:47
sauce31
Messages postés26Date d'inscriptionmardi 14 avril 2009StatutMembreDernière intervention 2 juin 2009
-
28 mai 2009 à 17:40
Bonjour,
Dans un formulaire, j'ai un datagridview dans lequel je saisie des nombres.
Hors, certains valeurs saisies sont suivies du signe $ qui me permettront de convertir les valeurs en € suivant un taux préalablement saisie.
J'aimerais donc, qu'au passage de la souris sur une cellule ayant le signe $, un tooltip s'affiche et me marque la valeur en convertie en €.
En regardant certains forums, j'ai écrit ce code là :
Private
Sub DataGridView1_MouseMove(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.MouseEventArgs)
Handles DataGridView1.MouseMove
Dim hitRow
As
Integer
Dim tool
As
New ToolTip
Dim hti As DataGridView.HitTestInfohti Me.DataGridView1.HitTest(e.X, e.Y)tool.ShowAlways
True
If hti.Type = DataGrid.HitTestType.Cell
And hti.RowY <> hitRow
Then
'And hti.RowIndex <> Me.DataGridView1.Rows Then hitRow = hti.RowY
tool.AutomaticDelay = 5000
tool.InitialDelay = 5
tool.ReshowDelay = 100
If tool.Active =
True
Then tool.Active =
False
End
If
If VB.Right(
Me.DataGridView1.Rows(hti.RowIndex).Cells(hti.ColumnIndex).Value, 1) =
"$"
Then nbVal = Replace(