TcxCanvas.DrawTexT(string,TRect,Integer,Boolean) Method
Draws formatted text within a specified rectangle on the canvas.
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
Text | string | A text string to display. |
R | TRect | The target rectangle on the canvas. |
Flags | Integer | A set of formatting flags. |
Enabled | Boolean | Specifies the Enabled state of the displayed text string. |
#Remarks
Call this procedure and pass a text string as the Text parameter to draw the string within a rectangle passed as the R parameter. The DrawTexT procedure uses the background color and font settings of the canvas to draw text.
You can pass False as the optional Enabled parameter to draw text for the disabled state of UI elements.
The Flags parameter accepts any combination of the following text draw mode flags:
Flag | Description |
---|---|
cx | Aligns text to the bottom of the target rectangle if the cx This flag corresponds to the DT_BOTTOM flag in an underlying GDI Draw |
cx | Centers text within the target rectangle. This flag replaces a combination of the cx |
cx | Centers text horizontally within the rectangle. This flag corresponds to the DT_CENTER flag in an underlying GDI Draw |
cx | Aligns text to the left border of the target rectangle. This flag corresponds to the DT_LEFT flag in an underlying GDI Draw |
cx | Aligns text to the right border of the target rectangle. This flag is ignored if the displayed text string is broken into multiple lines. This flag corresponds to the DT_RIGHT flag in an underlying GDI Draw |
cx | Aligns text to the top border of the target rectangle. This flag is ignored if the displayed text string is broken into multiple lines. This flag corresponds to the DT_TOP flag in an underlying GDI Draw |
cx | Centers text vertically within the target rectangle. This flag is ignored if the displayed text string is broken into multiple lines. This flag corresponds to the DT_VCENTER flag in an underlying GDI Draw |
cx | Forces the Draw This flag disables the DT_EDITCONTROL flag in an underlying GDI Draw |
cx | The Draw This flag corresponds to the DT_NOCLIP flag in an underlying GDI Draw |
cx | The Draw This flag corresponds to the DT_CALCRECT flag in an underlying GDI Draw |
cx | Expands tab characters. The default number of characters per tab is eight. This flag corresponds to the DT_EXPANDTABS flag in an underlying GDI Draw |
cx | The Draw This flag corresponds to the DT_END_ELLIPSIS flag in an underlying GDI Draw |
cx | Forces the Draw This flag disables the DT_NOPREFIX flag in an underlying GDI Draw |
cx | The Draw This flag corresponds to the DT_PATH_ELLIPSIS flag in an underlying GDI Draw |
cx | Forces the Draw This flag corresponds to the DT_SINGLELINE flag in an underlying GDI Draw |
cx | The Draw This flag corresponds to the DT_WORDBREAK flag in an underlying GDI Draw |