Product : Engine, Version : 4.1.6.1028, ArticleID : 41023340

HowTo : Highlight an entity as the mouse moves over the entity

Article41023340
TypeHowTo
ProductEngine
Version4.1.6.1028
Date Added12/17/2003
Submitted byPatrick Engel
Keywords

Subject

Highlight an entity as the mouse moves over the entity

Summary

How to highlight an entity as the mouse moves over the entity

Solution

See the Visual Basic 6 sample code below:

Option Explicit

Dim Handle_Global As String

Private Sub Form_Load()
    Set Handle_Global = ""
End Sub

Private Sub VD_CoordMouseMove(ByVal Xpos As Double, ByVal Ypos As Double)
Dim Pos     As Variant
Dim Ent     As vdFigure
Dim Ent_OLD As vdFigure

    Pos = VD.CursorPos
    Set Ent = VD.ActiveDocument.GetEntityFromPOINT(Pos)
    If Not (Ent Is Nothing) Then
        If Ent.Handle <> Handle_Global Then
            Ent.HighLight = VdHightLightDot
            Ent.Invalidate
            If Handle_Global <> "" Then
                Set Ent_OLD = VD.ActiveDocument.GetFromHandle(Handle_Global)
                Ent_OLD.HighLight = VdHightLightShowNormal
                Ent_OLD.Invalidate
            End If
            Handle_Global = Ent.Handle
        End If
    Else
        If Handle_Global <> "" Then
            Set Ent_OLD = VD.ActiveDocument.GetFromHandle(Handle_Global)
            Ent_OLD.HighLight = VdHightLightShowNormal
            Ent_OLD.Invalidate
        End If
        Handle_Global = ""
    End If

End Sub