TPE

http://bayanbox.ir/view/263405954590585756/2mobile.png

Tavvafi@gmail.com


≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

Sub HighlightMe(oSh as Shape)

    Dim lHighlightColor as Long

    ' Edit this to change the highlight color
    lHighlightColor = RGB(255,255,0)   ' bright yellow

    ' Look at the clicked shape's fill color
    With oSh.Fill.ForeColor

        ' Depending on the .RGB value of the fill color ...
        Select Case .RGB

            ' If it's already highlighted, we've "tagged"
            ' it with the original color; use that
            Case lHighlightColor
                .RGB = CLng(oSh.Tags("OriginalColor")

            ' Otherwise, it must not be highlighted so
            ' "tag" the shape with the RGB value of the current fill
            ' color, then change the fill to the highlight color
            Case Else
                Call oSh.Tags.Add("OriginalColor", CStr(.RGB))
                .RGB = lHighlightColor

        End Select

    End With

End Sub