windowsforms-devexpress-dot-xtrabars-dot-baredititemlink-379f29e4.md
Activates and moves focus to the editor associated with the link.
Namespace : DevExpress.XtraBars
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public override void Focus()
Public Overrides Sub Focus
The Focus method that is called for a BarEditItemLink object is equivalent to the BarEditItemLink.ShowEditor method.
The following example shows how you can focus a specific subitem within a container item.
The menu for the mFile item of the BarSubItem class is activated. To do this, the BarCustomContainerItemLink.OpenMenu method is called.
After the menu is opened, we focus the first subitem in it using the BarItemLink.Focus method.
The result is shown below:
// The item and its link for which the menu should be opened
BarSubItem containerItem = mFile;
BarSubItemLink containerLink = containerItem.Links[0] as BarSubItemLink;
// Open the menu for the link
containerLink.OpenMenu();
// Focus the first link in the menu opened
containerLink.VisibleLinks[0].Focus();
' The item and its link for which the menu should be opened
Dim containerItem As BarSubItem = mFile
Dim containerLink As BarSubItemLink = CType(containerItem.Links[0], BarSubItemLink)
' Open the menu for the link
containerLink.OpenMenu()
' Focus the first link in the menu opened
containerLink.VisibleLinks[0].Focus()
See Also