1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Private Sub Image2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
'InfoBulle est un Label
'Range("B1").Value = X 'Pour déterminer la situation de la zone concernée
'Range("C1").Value = Y 'Pour déterminer la situation de la zone concernée
If (X > 145 And X < 165) And (Y > 83 And Y < 102) Then
With Sheets("Feuil1").Range("A1")
.Value = "Le texte de mon info bulle"
.Font.Name = "Arial"
.Font.Size = 9
End With
Sheets("Feuil1").Rows("1").EntireRow.AutoFit ' pour récuperer des dimensions du texte
Sheets("Feuil1").Columns("A").EntireColumn.AutoFit
With InfoBulle
.Caption = Sheets("Feuil1").Range("A1").Value
.Height = Sheets("Feuil1").Rows("1").Height
.Width = Sheets("Feuil1").Columns("A").Width
.Top = Y + Image2.Top + 15
.Left = X + Image2.Left + 15
.Visible = True
End With
Else
InfoBulle.Visible = False
End If
End Sub
Private Sub UserForm_Initialize()
InfoBulle.Visible = False
End Sub |
Partager