Knowledge Base 
Specify where a CommandBar can be Docked 
 Wednesday, October 05, 2022

Specify where a CommandBar can be Docked

The DockingFlags property is used to specify where a commandbar can be docked. The following is the list of possible values that can be applied to the DockingFlags property:

#define _ACB_CBDF_ALIGNTOP		0x00000001
#define _ACB_CBDF_ALIGNBOTTOM	0x00000002
#define _ACB_CBDF_ALIGNLEFT		0x00000004
#define _ACB_CBDF_ALIGNRIGHT	0x00000008
                                    _ACB_CBDF_ALIGNBOTTOM + ;
                                    _ACB_CBDF_ALIGNLEFT + ;
You can combine values to tailor to your needs, for example, you can specify that the commandbar can be docked only to the top or bottom of the form.

The code below illustrates how to limit a commandbar so that it can only be docked to the top and bottom of the form:
ThisForm.cmdBarStandard.DockingFlags = 3      && _ACB_CBDF_ALIGNTOP + _ACB_CBDF_ALIGNBOTTOM
To completely disable docking, simply set the DockingFlags property to 0 and the DockPosition property to -1.
ThisForm.cmdBarStandard.DockingFlags = 0
ThisForm.cmdBarStandard.DockPosition = -1