FontControl element
Represents a Font Control, which is a specialized container of individual controls dedicated to font manipulation.
Usage
<FontControl
CommandName = "xs:positiveInteger or xs:string"
FontType = "xs:string"
IsGrowShrinkButtonGroupVisible = "Boolean"
IsStrikethroughButtonVisible = "Boolean"
IsUnderlineButtonVisible = "Boolean"
IsHighlightButtonVisible = "Boolean"
ShowVerticalFonts = "Boolean"
ShowTrueTypeOnly = "Boolean"
MinimumFontSize = "xs:positiveInteger"
MaximumFontSize = "xs:positiveInteger"/>
Attributes
Attribute | Type | Required | Description |
---|---|---|---|
CommandName |
xs:positiveInteger or xs:string |
No |
Associates the element with a Command. The value must be unique within the Ribbon XML document. Maximum length: 100 characters. |
FontType |
xs:string |
No |
Restricted to one of the following values: Setting the FontType attribute to FontOnly enables the following functionality:
Setting the FontType attribute to FontWithColor enables the following functionality:
Setting the FontType attribute to RichFont enables the following functionality:
|
IsGrowShrinkButtonGroupVisible |
Boolean |
No |
Windows 8 and newer Restricted to one of the following values: Note:
FontWithColor or RichFont .FontOnly . |
IsHighlightButtonVisible |
Boolean |
No |
Restricted to one of the following values (0 and 1 are not valid): Note:
FontWithColor or RichFont .Valid only when the value of FontType equals FontWithColor or RichFont .FontOnly .Valid only when the value of FontType equals FontOnly or FontWithColor . |
IsStrikethroughButtonVisible |
Boolean |
No |
Restricted to one of the following values (0 and 1 are not valid): FontOnly or FontWithColor . |
IsUnderlineButtonVisible |
Boolean |
No |
Restricted to one of the following values (0 and 1 are not valid): FontOnly or FontWithColor . |
MaximumFontSize |
xs:positiveInteger |
No |
The maximum point size to display. Default is 9999. |
MinimumFontSize |
xs:positiveInteger |
No |
The minimum point size to display. Default is 1. |
ShowTrueTypeOnly |
Boolean |
No |
Restricted to one of the following values (0 and 1 are not valid): |
ShowVerticalFonts |
Boolean |
No |
Restricted to one of the following values (0 and 1 are not valid): Note:
Note:
|
Child elements
There are no child elements.
Parent elements
Element |
---|
ControlGroup |
Group |
MenuGroup |
Remarks
Optional.
May occur at most once for each ControlGroup, Group, or MenuGroup element.
Any FontControl Command attributes declared in markup, such as Command.LabelTitle or Command.TooltipTitle, are overridden by the attributes of the individual controls that comprise the FontControl.
Any attempt to select a color swatch from the color picker of a Font Control may result in an access violation if no Command handler is associated with the control.
Examples
The following example demonstrates the basic markup for the three types of Font Control.
This section of code shows the FontControl Command declarations, each with a Group container declaration.
<!-- A FontOnly FontControl -->
<Command Name="cmdFontOnlyGroup"
Symbol="cmdFontOnlyGroup"
Comment="FontOnlyGroup"
Id="50001"
LabelTitle="FontOnly"/>
<Command Name="cmdFontOnly"
Symbol="cmdFontOnly"
Comment="FontOnly"
Id="50010"/>
<!-- A FontWithColor FontControl -->
<Command Name="cmdFontWithColorGroup"
Symbol="cmdFontWithColorGroup"
Comment="FontWithColorGroup"
Id="50002"
LabelTitle="FontWithColor"/>
<Command Name="cmdFontWithColor"
Symbol="cmdFontWithColor"
Comment="FontWithColor"
Id="50020"/>
<!-- A RichFont FontControl -->
<Command Name="cmdRichFontGroup"
Symbol="cmdRichFontGroup"
Comment="RichFontGroup"
Id="50003"
LabelTitle="RichFont"
Keytip="ZF"/>
<Command Name="cmdRichFont"
Symbol="cmdRichFont"
Comment="RichFont"
Id="50030"
Keytip="RF"
LabelTitle="test"
TooltipTitle="test"/>
This section of code shows the FontControl control declarations where each FontControl and Group is declared in a single Tab.
<Tab CommandName="cmdTab1">
<Group CommandName="cmdFontOnlyGroup"
SizeDefinition="OneFontControl">
<FontControl CommandName="cmdFontOnly"
FontType="FontOnly"
IsUnderlineButtonVisible="false"
IsStrikethroughButtonVisible="false"
MinimumFontSize="15"/>
</Group>
<Group CommandName="cmdFontWithColorGroup"
SizeDefinition="OneFontControl">
<FontControl CommandName="cmdFontWithColor"
FontType="FontWithColor"
IsUnderlineButtonVisible="false"
IsStrikethroughButtonVisible="false"
IsHighlightButtonVisible="true"
MinimumFontSize="15"/>
</Group>
<Group CommandName="cmdRichFontGroup"
SizeDefinition="OneFontControl">
<FontControl CommandName="cmdRichFont"
FontType="RichFont"
IsHighlightButtonVisible="true"
IsUnderlineButtonVisible="true"
IsStrikethroughButtonVisible="true"
ShowVerticalFonts="true"
MinimumFontSize="15"/>
</Group>
Element information
- Minimum supported system: Windows 7
- Can be empty: Yes