Color scheme: Light
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » Navigation and commands » WklActionBar

WklActionBar

The header of a page or an application shell: a band with title, subtitle and status, and below it a command row in the look of the Office command bars.

Get started

None

Common tasks

Visual aid

+------------------------------------------------------------------------------+
| People                                                  ( Connected ) (3)  1 |
| People, their keys and sign-ins                                            2 |
+------------------------------------------------------------------------------+
| + New  Edit   [ Issue key | v ]   ... More v                 Export  Refresh |
| 3             4                   5                          6               |
+------------------------------------------------------------------------------+
RegionMeaning
1StatusText as a pill in the colors of StatusKind, with StatusCount beside it.
2The band: Caption (empty: the form's caption) and Subtitle, in BackColor and ForeColor; from 1.58 an optional Logo at its left, with the texts beside it.
3Commands with wcpStandard, in the order they were added; they move into More when the row is too narrow.
4The primary command (wcpPrimary) in the accent color; with children (Parent) it is a split button.
5More (MoreCaption, MoreGlyph): the commands with wcpMenu, then those that did not fit.
6The right group (wcpRight), always visible.

Key features

  • One bar for a whole shell. The shell sets the commands of each page in code - one JSON text (Commands) or AddCommand - and receives every choice in one event, CommandClick(Key).
  • Measures itself. Buttons take the width of their captions; what does not fit moves into More from the end of the row, the primary command last; the right group stays.
  • Like Office. Access keys (& in captions), tooltips with the shortcut (“New (Ctrl+N)”), split buttons, separators (BeginGroup), one tab stop with the arrow keys inside, and a toolbar with buttons for screen readers.
  • Shortcuts for the whole form. A command's Shortcut (^N, {F5}) works wherever the focus is, in subforms too.
  • State per record. CommandEnabled, CommandVisible and CommandCaption by key, for buttons and menu entries alike.

Core concepts

The command row is 40 pixels high; the band takes the rest of the control's height. Title (14 pt) and subtitle (9 pt) need about 48 pixels of band, so give the control at least 88 pixels (1 320 twips at 100 %); with less, the band shows the title only and leaves the subtitle out rather than cutting it.

The commands are a model of the framework's core (ActionCommands): keys, placement, children, shortcuts and their rules, and the arrangement of a row of a given width (ActionBarLayout). The bar draws that model; the buttons are drawn by the same code as WklButton, the menus are the menus of WklButton. Commands set in design view are stored with the form; set in form view they are not a change of the form. Shortcuts are watched by the same message hook of the form as F6 of WklDockLayout, so a combination belongs either to the bar or to WklDockLayout.ShortcutKeys.

Administration

Troubleshooting

None

For developers

None

en/wiki/msaccess/comctl/navigation-and-commands/actionbar/start.txt · Last modified: by Wolfgang van der Stille