Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Hotspot Object / Tooltip Property
Example
In This Topic
    Tooltip Property (Hotspot)
    In This Topic
    Gets or sets the text to display when the mouse cursor is over the hotspot.
    Syntax
    expression.Tooltip As String
    where expression is a variable that represents a Hotspot Object
    Example
    This example creates a hotspot on an item in an option list (the "mtest2" option), creates a tooltip for the hotspot, and saves it to a custom hostpots map.
    'This example creates a hotspot on an item in an option list (the "mtest3" option).
    '    1. mtest1   - Greeting
    '    2. mtest2   - Test2
    '    3. mtest3   - Selective Erase
     
    'When double-clicked, the hotspot enters "3" on the command line to select that option.
     
    Sub AddHotspotAndCreateHotspotMap()
     
        'Create a new action sequence
        Dim myActionSeq As New InputMapActionSequence
        
        'Add an action to send menu item "3" and add the action to the action sequence
        Dim myAction As New InputMapAction
        myAction.ActionId = InputMapActionID_SendHostTextAction
        myAction.AddParameter "3" & Chr(13)
        myActionSeq.Add myAction
        
        'Add an action to send the Enter control key and add this action to the action sequence
        Dim myAction2 As New InputMapAction
        myAction2.ActionId = InputMapActionID_SendHostKeyAction
        myAction2.AddParameterAsInteger ControlKeyCode_Enter
        myActionSeq.Add myAction2
     
        'Add a new hotspot that is activated by the 'mtest3' string on the screen menu item 3
        Dim myHotSpot As New Hotspot
        myHotSpot.text = "mtest3"
     
        'Add a tooltip for the hotspot
        myHotSpot.Tooltip = "Go to Selective Erase"
             
        'Link the action sequence to the hotspot
        Set myHotSpot.ActionSequence = myActionSeq
     
        'Add the new hotspot to the currently selected hotspots map
        ThisScreen.ScreenHotSpots.AddHotspot myHotSpot
        
        'Make sure Hotspots are enabled and display as buttons
        ThisScreen.ScreenHotSpots.HotSpotsEnabled = True
        ThisScreen.ScreenHotSpots.HotSpotStyle = HotspotStyleOption_Button
        
        'Apply the hotspots
        ThisScreen.ScreenHotSpots.ApplyCurrentHotspots
         
        'At this point you can use the new hotspot in the session -- but it is "in memory" only
        
        'If you are using a custom hotspot map that resides in your user data directory, you can save the current hotspot map using the Save method. This doesn't work if you
        'are using a default hotspot in the programs directory because saving a default hotspot just creates a new file in the user data directory and doesn't reassign it to the session.
        'ThisScreen.ScreenHotSpots.Save
        
        'If you are using a default hotspot, save the current hotspots in a new hotspots map file and assign it to the session as follows:
        Dim newHotspotsMap As String
        newHotspotsMap = Environ("USERPROFILE") & "\Documents\micro focus\reflection\Hotspots Maps\MyCustomHotspotsMap.xhs"
        ThisScreen.ScreenHotSpots.SaveAs (newHotspotsMap)
        
        'Assign the new hotspot map to the session
        ThisScreen.ScreenHotSpots.HotspotsMap = newHotspotsMap
     
    End Sub
    See Also