Class TextBoxPaint
A class for painting text and make it emulate the look how text is rendered by a System.Windows.Controls.TextBox
Namespace: Syncfusion.Windows.GridCommon
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class TextBoxPaint : Object
Constructors
TextBoxPaint(Typeface, Double, Brush)
Initializes a new instance of the TextBoxPaint class.
Declaration
public TextBoxPaint(Typeface typeface, double emSize, Brush foreGround)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.Typeface | typeface | The typeface. |
System.Double | emSize | Size of the em. |
System.Windows.Media.Brush | foreGround | The fore ground. |
Properties
CultureInfo
Gets or sets the culture info.
Declaration
public CultureInfo CultureInfo { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo | The culture info. |
EmSize
Gets or sets the size of the em.
Declaration
public double EmSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The size of the em. |
FlowDirection
Gets or sets the flow direction.
Declaration
public FlowDirection FlowDirection { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.FlowDirection | The flow direction. |
Foreground
Gets or sets the fore ground.
Declaration
public Brush Foreground { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The fore ground. |
HorizontalAlignment
Gets or sets the horizontal alignment.
Declaration
public TextAlignment HorizontalAlignment { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.TextAlignment | The horizontal alignment. |
Orientation
Gets or sets the orientation.
Declaration
public double Orientation { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The orientation. |
TextDecorations
Gets or sets the text decorations.
Declaration
public TextDecorationCollection TextDecorations { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.TextDecorationCollection | The text decorations. |
TextWrapping
Gets or sets the text wrapping.
Declaration
public TextWrapping TextWrapping { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.TextWrapping | The text wrapping. |
Trimming
Gets or sets the trimming.
Declaration
public TextTrimming Trimming { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.TextTrimming | The trimming. |
Typeface
Gets or sets the typeface.
Declaration
public Typeface Typeface { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Typeface | The typeface. |
VerticalAlignment
Gets or sets the vertical alignment.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.VerticalAlignment | The vertical alignment. |
WrapText
Gets or sets a value indicating whether text is wrapped.
Declaration
public bool WrapText { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
CenterInRect(Rect, Size)
Returns a centered rectangle of a specified size within a given rectangle.
Declaration
public static Rect CenterInRect(Rect rect, Size size)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Rect | rect | The outer rectangle. |
System.Windows.Size | size | The size of the rectangle to be centered. |
Returns
Type | Description |
---|---|
System.Windows.Rect | The centered rectangle. |
CenterPoint(Rect)
Returns a centered point within a given rectangle.
Declaration
public static Point CenterPoint(Rect rect)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Rect | rect | The outer rectangle. |
Returns
Type | Description |
---|---|
System.Windows.Point | The centered point. |
DrawText(DrawingContext, Rect, String)
Draws the text.
Declaration
public void DrawText(DrawingContext drawingContext, Rect textRectangle, string displayText)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The drawing context. |
System.Windows.Rect | textRectangle | The text rectangle. |
System.String | displayText | The display text. |
FromLTRB(Double, Double, Double, Double)
Creates a Rect.
Declaration
public static Rect FromLTRB(double left, double top, double right, double bottom)
Parameters
Type | Name | Description |
---|---|---|
System.Double | left | The left. |
System.Double | top | The top. |
System.Double | right | The right. |
System.Double | bottom | The bottom. |
Returns
Type |
---|
System.Windows.Rect |
GetFrozenBrush(Color)
Gets the frozen brush.
Declaration
public static Brush GetFrozenBrush(Color textColor)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.Color | textColor | Color of the text. |
Returns
Type |
---|
System.Windows.Media.Brush |
GetTypeface(String)
Gets the typeface.
Declaration
public static Typeface GetTypeface(string faceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | faceName | Name of the type face. |
Returns
Type |
---|
System.Windows.Media.Typeface |