Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / MouseClickEx Event
Example
In This Topic
MouseClickEx Event
In This Topic
This event occurs when a session window is clicked by the mouse.
Syntax
private Sub IbmScreen_MouseClickEx ( 
   ByVal windowMessage As Integer, _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal X As Integer, _
   ByVal Y As Integer _
) 

Parameters

windowMessage
Window message that contains the mouse click event.
row
The terminal row number of the mouse click.
column
The terminal column number of the mouse click.
X
The x-coordinate of the mouse click, in pixels, relative to the left side of the session window.
Y
The y-coordinate of the mouse click, in pixels, relative to the top of the session window.
Example
This example prints the text in a field when the mouse is clicked in the field.
Private Sub IbmScreen_MouseClickEx(ByVal windowMessage As Long, ByVal row As Long, ByVal column As Long, ByVal x As Long, ByVal y As Long)
 
    'When the the left mouse button is released (windowMessage = 514 is WM_LBUTTONUP), get the field the mouse is in and print the text in the field.
    If windowMessage = 514 Then
        Sleep 200
      
        Dim myField As HostField
        Dim myFieldText As String
 
        'Get the field
        Set myField = ThisIbmScreen.GetField(row, column)
 
        'Print the text in field that was clicked
        myFieldText = myField.text
        Debug.Print myFieldText
    
    End If
    
End Sub
See Also