Partilhar via


TextField.GetTextBrush Method

Gets the brush to draw the text 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

'Declaração
Public Overridable Function GetTextBrush ( _
    view As DiagramClientView, _
    parentShape As ShapeElement _
) As Brush
public virtual Brush GetTextBrush(
    DiagramClientView view,
    ShapeElement parentShape
)
public:
virtual Brush^ GetTextBrush(
    DiagramClientView^ view, 
    ShapeElement^ parentShape
)
abstract GetTextBrush : 
        view:DiagramClientView * 
        parentShape:ShapeElement -> Brush 
override GetTextBrush : 
        view:DiagramClientView * 
        parentShape:ShapeElement -> Brush 
public function GetTextBrush(
    view : DiagramClientView, 
    parentShape : ShapeElement
) : Brush

Parameters

Return Value

Type: System.Drawing.Brush

Remarks

By default, this method returns the default text brush of this ShapeField. To dynamically change the text brush for this ShapeField, consider overriding GetTextBrushId first. If that method is inadequate, override this method.

public virtual Brush GetTextBrush(DiagramClientView view, ShapeElement parentShape)
{
StyleSet parentStyleSet = (parentShape != null) ? parentShape.StyleSet : null;

return (parentStyleSet != null)
? parentStyleSet.GetBrush(GetTextBrushId(view, parentShape))
: null;
}

.NET Framework Security

See Also

Reference

TextField Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace