Before reading this article, I highly recommend reading the previous parts of the series.
In this article, we are going to learn about CommandBar control in Modern C++.
A CommandBar is divided into the following two main areas,
CommandArea A Command Area has a collection of AppBarButton, AppBarToggleButton and AppBarSeparator buttons only. We can’t add any extra controls into the list, directly under the Command Area. Note All three controls are not necessary to be present in the CommandBar. A Command Area is divided into the following two areas,
Primary and secondary commands are a priority and non-priority area, the priority area is always visible to the users, a non-priority area is always hidden to the users. Whenever the user wants to interact with the secondary area, click the “…” menu visible to the UI.
Secondary commands Secondary commands are non-priority areas, but once the user has clicked the secondary area, we make it visible until the user interacts with the CommandBar based on the context menu. Generally, if we click outside the menu area, the overflow menu automatically disappears.
Note
IsSticky property can be set as overall the CommandBar properties, it applies to the primary Command Area.
IsOpen
IsOpen is true, CommandBar is open (Primary and secondary commands details will be visible to the user); If it's false default behaviors are applying to the user
Content The Content area is like a container, we can place any control inside the content area.
DisplayMode Initial or runtime, we can change the display mode of the CommandBar, the default mode is compact mode. ClosedDisplayMode is a property to change the display mode of the CommandBar,
Conclusion
I hope you understood how to use the CommandBar control.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: