Articles in this section
Category / Section

How to customize the CommandBar item alignment in CommadBarController?

1 min read

Refer to the following steps for CommandBar items alignment.

  1. Command Bar is not a container type of control and it allows you to rearrange the controls in desired position.
  2. You have to add the desired controls as Panel child controls.
  3. Then add them as CommandBar control child.

The following code example is to demonstrate the same.

C#

//Adding panel1 as its child component
this.commandBarAddress.Controls.Add(this.panel1);
//Aadding child items to panel
this.panel1.Controls.Add(this.buttonAdv1);
//Alignment can be set by using dock property or can place the control as required
this.buttonAdv1.Dock = System.Windows.Forms.DockStyle.Right;

VB

'Adding panel1 as its child component
Me.commandBarAddress.Controls.Add(Me.panel1)
'Adding child items to panel
Me.panel1.Controls.Add(Me.buttonAdv1)
'Alignment can be set by using dock property or can place the control as required
Me.buttonAdv1.Dock = System.Windows.Forms.DockStyle.Right

Sample

http://www.syncfusion.com/downloads/support/directtrac/general/Commadbar-632032339.zip

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied