Identifying the dragged control

To identify the type of control that was dropped, use the source argument of the DragDrop event.

This script for the DragDrop event in a picture declares two variables, then determines the type of object that was dropped:

CommandButton lcb_button
StaticText lst_info

IF source.TypeOf() = CommandButton! THEN
		lcb_button = source
		lcb_button.Text = "You dropped a Button!"
ELSEIF source.TypeOf() = StaticText! THEN
		lst_info = source
		lst_info.Text = "You dropped the text!"
END IF

NoteUsing CHOOSE CASE If your window has a large number of controls that can be dropped, use a CHOOSE CASE statement.