Using Drag and Drop
- 3 minutes to read
Users can customize toolbar and item control layout via drag and drop (both at design and runtime). This topic describes available drag and drop operations.
Drag & drop operations on toolbars
Drag & drop operations on item controls
Drag & drop operations on toolbars
The following drag & drop operations can be executed by users:
- Dragging toolbars within rows, from one row to another and from one side of a form to another.
Users can drag a toolbar to a row that contains another toolbar, only if the latter toolbar’s OneOnRow property is set to False. You can prohibit a certain toolbar or all toolbars on a form from being docked to the form’s sides via the toolbar’s NotDocking property and a bar manager’s NotDocking property, respectively.
The image below displays dragging a toolbar from one row to another and then to the right side of a form.
- Float a toolbar and return back to its recent dock location.
Use a bar manager’s NotDocking property to prevent this operation.
Note that these operations can also be executed by double-clicking a toolbar or by clicking a toolbar’s drag grip when holding down the Ctrl key.
The image below describes this process.
- Resizing floating toolbars.
The maximum width of a toolbar is determined by the integral width of its items. The minimum width is limited to the width of a single item. The value of a toolbar’s height is changed in the same way.
The following image displays possible variants.
Drag & drop operations on item controls
Users can customize the layout of toolbar items via the following:
- Dragging an item control on and between toolbars, submenus, and popup menus.
Item controls can be dragged when the Customization Form is displayed.
Users can change the order of item controls on a toolbar by dragging them within it. Toolbar layout on a form can be modified by dragging item controls between them. Dragging an item control a short distance to the end of a toolbar leads to the creation of a separator before the item control.
The following image displays drag operations between a toolbar and a submenu:
Duplicating a toolbar item control by holding down the Ctrl key and dragging an existing item control to any toolbar, submenu, or popup menu.
Dragging an item control away from toolbars (deletes the item control).
Users can delete any item control (including a submenu) using this method provided that the Customization Form is displayed. This process is described in the image below.
- Dragging a toolbar item from the Customization Form and dropping on a toolbar, submenu, or popup menu.
Users can add an item control of an existing item to a toolbar, submenu, or popup menu by dragging the item from the Commands list in the Commands page of the Customization Form to the toolbar, submenu, or popup menu. In the image below, the Close item is added to the File submenu.