Stub Glyphs

  • 3 minutes to read

Bar items and their links display images and string captions. Images are assigned by using the following properties.

When none of these properties are specified, links to bar items will, by default, display stub glyphs instead. A stub glyph is a colored square with rounded corners and one or two of the initial letters of the item caption. These fake icons are primarily used to quickly identify icons that have no icons as yet so you won't miss them. The figure below illustrates a sample.

StubGlyphs - Ribbon Sample

Enable Stub Glyphs

You can enable stub glyphs for all item links within a Ribbon (toolbars), or for individual links only. To enable stub glyphs for all items at once, access the BarManager.OptionsStubGlyphs or RibbonControl.OptionsStubGlyphs properties section and set the StubGlyphOptions.AllowStubGlyphs property to DefaultBoolean.True or DefaultBoolean.Default.

Individual items provide the BarItem.AllowStubGlyph properties that, when not set to DefaultBoolean.Default, override the global setting. For example, the following figure illustrates the "Cut" bar item link that displays a stub glyph while other links don't.

StubGlyphs - Override Default


ribbonControl1.OptionsStubGlyphs.AllowStubGlyphs = DefaultBoolean.False;
iCut.AllowStubGlyph = DefaultBoolean.True;

Customize Stub Glyphs

The BarManager.OptionsStubGlyphs and RibbonControl.OptionsStubGlyphs sections provide multiple properties to customize the appearance of item stub glyphs.

Property

Description

StubGlyphOptions.CaseMode

Allows you to choose the case mode for captions within stub glyphs. Accepts the following values of the GlyphTextCaseMode enumerator.

  • UpperCase - all glyph caption characters are in the upper case.
  • LowerCase - all glyph caption characters are in the lower case.
  • SentenceCase or Default - the first glyph caption character is in the upper case, the second one is in the lower case.

StubGlyphs - Case Mode

StubGlyphOptions.ColorMode

By default, each stub glyph is painted using a random color from six available colors. You can utilize this property to explicitly choose one specific color for all stub glyphs.

StubGlyphs - Color Mode

StubGlyphOptions.CornerRadius

Specifies the corner radius for rectangular stub glyphs (see the "Type" property). Set this property to 0 for straight square icons.

StubGlyphs - Corner Radius

StubGlyphOptions.Font

Specifies the font settings for stub glyphs' caption strings. The following figure illustrates glyph captions painted using the bold "Segoe Condensed" font.

StubGlyphs - Font Settings

StubGlyphOptions.HorizontalAlignment

StubGlyphOptions.VerticalAlignment

Two properties that allow you to arrange stub glyph captions into one of nine predefined positions.

StubGlyphs - Alignment

StubGlyphOptions.LetterCount

Stub glyph captions always start with the first character of their related bar item captions. Set this property to GlyphTextSymbolCount.Two to draw the second character as well. Displaying two characters requires more space and thus, is primarily recommended for large bar item links.

StubGlyphs - Letter Count

StubGlyphOptions.Padding

Gets or sets the distance between glyph borders and inner text content.

StubGlyphs - Padding

StubGlyphOptions.RandomizeColors

Gets or sets whether different variations of the same hue are enabled.

StubGlyphs - Random Colors

StubGlyphOptions.Type

Switches between rectangular and circular stub glyphs. For rectangular glyphs, you can additionally specify the StubGlyphOptions.CornerRadius property.

StubGlyphs - Type