Where is the Mouse?


This example shows how to detect which control the cursor is over. The script uses the {TIMER} event to periodically call the UI_DLG_CONTROL_FROM_POS()function, which returns the location of the cursor.

dim dlg_title as C
dlg_title = "Where is the Mouse"
Move the mouse around the dialog. Notice that as you move the mouse, the current control's definition is shown.;
First name: |[.20fname];
Last name: |[.20lname];
City: |[.20city] State: [.4state] Zip: [.6zip];
Current control:;
<10&OK!ok> <10&Cancel!cancel>;
if (a_dlg_button = "timer") then
    a_dlg_button = ""
    current_control = ui_dlg_control_from_pos(dlg_title)
    current_control = remove_blank_lines(current_control)
end if


Desktop applications only

See Also