Share via


TextField.GetFont Method

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

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

Syntax

'Declaration
Public Overridable Function GetFont ( _
    parentShape As ShapeElement _
) As Font
public virtual Font GetFont(
    ShapeElement parentShape
)
public:
virtual Font^ GetFont(
    ShapeElement^ parentShape
)
abstract GetFont : 
        parentShape:ShapeElement -> Font 
override GetFont : 
        parentShape:ShapeElement -> Font 
public function GetFont(
    parentShape : ShapeElement
) : Font

Parameters

Return Value

Type: System.Drawing.Font

Remarks

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

.NET Framework Security

See Also

Reference

TextField Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace