Property AssignHotKeys
AssignHotKeys
If true, unique hotkeys will automatically be assigned to focusable subviews that have a Title but no HotKey defined.
UsedHotKeys will be used to ensure unique keys are assigned. Set UsedHotKeys before adding subviews with any hotkeys that may conflict with other Views.
public bool AssignHotKeys { get; set; }
Property Value
Remarks
When enabled, hotkeys are assigned to subviews when they are added via Add(View?). The assignment algorithm:
- Checks if the subview already has a programmatically set HotKey; if so and the key is not already used, preserves that hotkey
- If no usable programmatic HotKey is found, checks if the subview's Title contains a hotkey specifier (e.g., "_File") and preserves it if the key is not already used
- If neither a usable programmatic hotkey nor a usable title specifier is found, assigns a new hotkey from the first available character in the title
- Skips characters that are already in UsedHotKeys, as well as spaces and control characters, when determining whether a hotkey is usable or when assigning a new one
Call AssignHotKeysToSubViews() to manually trigger hotkey assignment for all subviews.