TextField::GetFont Method (ShapeElement^)

 

Gets the font to draw with for the specified ShapeElement instance.

Namespace:   Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

public:
virtual Font^ GetFont(
	ShapeElement^ parentShape
)

Parameters

parentShape
Type: Microsoft.VisualStudio.Modeling.Diagrams::ShapeElement^

The ShapeElement on which to draw.

Return Value

Type: System.Drawing::Font^

The default method looks up the font ID in the style set of the parent shape:

public virtual Font GetFont(ShapeElement parentShape)
{
  StyleSet parentStyleSet = (parentShape != null) ? parentShape.StyleSet : ApplicationStyleSet.StyleSet;
  return parentStyleSet.GetFont(GetFontId(parentShape));
}

For more information and examples, see TextField

Return to top
Show: