AW: Quick Info
27.10.2003 13:31:01
Dan
Hallo,
es ging mir nich die Datei zum Server laden, also schicke ich nur den Code-Beispiel. Es ist nur eine Aushilfe, und es ist auch nicht besonders flexible :-). Man muss dabei den Image Control benutzen und fur jeden Image dann die Proc. QuickInfo rufen, aber von eigener MouseMove Proc. Also wenn man z.B 4 Images in den Sheet zugibt, muss man auch fur jeden der Images eine MoseMove Proc. kopierren. Das ist eigentlich ganz schon umstandlich :-). Falls du Fragen hast, dann mailto dusek@cb.vakjc.cz, mfg. Dan.
Option Explicit
Private Shps As Shapes
Private shQInfo As Shape
Const QInfoWidth As Integer = 70
Const QInfoHeight As Integer = 25
Const QInfoText1 As String = "Dies ist Quick-Info fur Img.1"
Const QInfoText2 As String = "Dies ist Quick-Info fur Img.2"
Const QInfoText3 As String = "Dies ist Quick-Info fur Img.3"
Const QInfoText4 As String = "Dies Bild ist leer."
Private Sub Image1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Call QuickInfo(Me.Image1, X, Y, QInfoText1)
End Sub
Private Sub Image2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Call QuickInfo(Me.Image2, X, Y, QInfoText2)
End Sub
Private Sub Image3_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Call QuickInfo(Me.Image3, X, Y, QInfoText3)
End Sub
Private Sub Image4_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Call QuickInfo(Me.Image4, X, Y, QInfoText4)
End Sub
Private Sub QuickInfo(ByVal ImgCtl As Object, ByVal QInfoX As Single, ByVal QInfoY As Single, ByVal QInfoText As String)
QInfoX = QInfoX + ImgCtl.Left
QInfoY = QInfoY + ImgCtl.Top
If ( _
(QInfoX > ImgCtl.Left + 10) And _
(QInfoX < (ImgCtl.Left + ImgCtl.Width - (QInfoWidth + 10))) And _
(QInfoY > ImgCtl.Top + 10) And _
(QInfoY < (ImgCtl.Top + ImgCtl.Height - (QInfoHeight + 10))) _
) Then
If (shQInfo Is Nothing) Then
Set Shps = ActiveSheet.Shapes
Set shQInfo = Shps.AddTextbox(msoTextOrientationHorizontal, QInfoX, QInfoY, QInfoWidth, QInfoHeight)
shQInfo.TextFrame.Characters.Text = QInfoText$
Else
shQInfo.Left = QInfoX: shQInfo.Top = QInfoY
End If
' shQInfo.tex
Else
If (Not shQInfo Is Nothing) Then
shQInfo.Delete
Set shQInfo = Nothing
End If
End If
End Sub