This topic only applies for annotation automation mode.
If more than one object is selected when the right mouse button is pressed, the "Group" menu option appears and lets you group the selected objects. From that moment on, all the grouped objects are acted on as one in automation mode. When you select one object, all objects become selected. When you unselect an object belonging to a group, all objects in that group are unselected.
To select only one object in a group, you must ungroup them. When you select a "grouped" set of objects and press the right mouse button, the "Ungroup" option appears in the menu. Selecting that option "ungroups" the objects. After that, objects are independent (you can select one without selecting the others).
Objects that are in a subcontainer of the main container are treated in the automated mode as grouped. When you select/unselect one object belonging to a group, all the other objects belonging to the same group are selected/unselected.
To programmatically move all the objects belonging to a group you have two choices:
1. Move the subcontainer, which contains all the objects (not the best solution)
2. Move all the objects present in that container (the better solution).
The problem with moving the container is that objects are clipped to their container. So if the subcontainer has an offset of 100 and you try to move the objects in the automated mode, then you cannot move the objects all the way to the left. You will be able to move the objects in the automated mode, but their left side will disappear.
This means that if you are going to use subcontainers and automated mode at the same time, then you should create the subcontainers so that they have the same size as the main container. Or, you can intercept the WM_LTANNEVENT message and keep track of the mouse notifications. And move the subcontainer whenever the mouse moves.
To create a group of objects, you can create a container, insert all the objects in it and insert that container in the main container (without stripping the container).