Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / UiControlActionMapper Object / Add Method
A UiControl object containing properties and operations on the control.
An InputMapActionSequence object containing a set of actions that are mapped to an input mapping.
Example
In This Topic
Add Method (UiControlActionMapper)
In This Topic
Adds the input map action sequence to the given user interface control.
Syntax
expression.Add( _
   ByVal uiControl As UiControl, _
   ByVal inputMapActionSequence As InputMapActionSequence _
) 
where expression is a variable that represents a UiControlActionMapper Object

Parameters

uiControl
A UiControl object containing properties and operations on the control.
inputMapActionSequence
An InputMapActionSequence object containing a set of actions that are mapped to an input mapping.
Example

This example maps a macro to a button control that was added in the UI designer.


To run this example, use the UI Designer to create a button control and note the button ID. Then edit the code below to use that ID.

Sub MapActionToControl()
 
    Dim sequence As InputMapActionSequence
    Dim action As InputMapAction
    Dim control As UiControl
 
    Dim ui As UiMode
 
    'Set an InputMapActionSequence to map the button to.
    Set sequence = New InputMapActionSequence
    
    'Set an action to add to the sequence.
    Set action = New InputMapAction
                         
    'Set the action to run a macro named GetReport.
    action.ActionId = InputMapActionID_RunMacroAction
    
    action.AddParameter "Module1.GetReport" 'Set the name of the macro.
 
    action.AddParameterAsInteger MacroEnumerationOption_Document 'Look for the macro in this Session project.
       
    action.AddParameterAsBoolean False 'Don't ask for any input at runtime.
 
    'Add the action to the action sequence
    sequence.Add action
    
    'get the control from the control ID. You'll need to get this value from the UI Designer. In this example, the control ID is "button7"
    
    'Edit this line to use the ID of your button.
    Set control = ThisView.UiMode.GetControlById("button7")
    
    'Add the action sequence to the control
    ThisIbmTerminal.UiControlActionMapper.Add control, sequence
   
End Sub
See Also