Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ToolbarFormControl.TitleItemLinks Property

Provides access to bar item links displayed in this ToolbarFormControl.

Namespace: DevExpress.XtraBars.ToolbarForm

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

#Property Value

Type Description
DevExpress.XtraBars.ToolbarForm.ToolbarFormLinkCollection

The collection of bar item links.

#Remarks

Both sides of a ToolbarFormControl have areas that can host bar items and links. These areas display items from the same TitleItemLinks collection. To specify whether an item should be aligned to the ToolbarFormControl’s left or right edge, specify the BarItem.Alignment property.

 ToolbarForm myForm = new ToolbarForm();
 myForm.Size = new Size(800, 600);
 myForm.Text = "Toolbar Form";
 ToolbarFormManager tfcManager = new ToolbarFormManager() { Form = myForm };
 ToolbarFormControl tfcHeader = new ToolbarFormControl() { ToolbarForm = myForm, Manager = tfcManager};
 myForm.Controls.Add(tfcHeader);
 myForm.ToolbarFormControl = tfcHeader;

 //create four buttons
 BarButtonItem item1 = new BarButtonItem(tfcManager, "Button 1");
 BarButtonItem item2 = new BarButtonItem(tfcManager, "Button 2");
 BarButtonItem item3 = new BarButtonItem(tfcManager, "Button 3");
 BarButtonItem item4 = new BarButtonItem(tfcManager, "Button 4");
 //buttons 3 and 4 will be docked to the ToolbarFormControl's right edge
 item3.Alignment = item4.Alignment = BarItemLinkAlignment.Right;

 //Out of two items added to the TitleItemLinks collection, the item that was added first
 //will be closer to the form edge. For that reason, you need to populate the right area
 //backwards, i.e. start with rightmost item 
 tfcHeader.TitleItemLinks.AddRange(new BarItem[] { item1, item2, item4, item3});

 myForm.Show();
See Also