Input for WinForms | ComponentOne
C1.Framework.Extension Namespace / TextBoxEx Class / DrawText Method
The System.Windows.Forms.TextBox in which the text is drawn.
The System.Drawing.Graphics object used to paint.
The text to be drawn.
The foreground color of the text.
The background color of the text.

In This Topic
    DrawText Method
    In This Topic
    Draws a text in the System.Windows.Forms.TextBox client area.
    Syntax
    'Declaration
     
    
    Public Shared Sub DrawText( _
       ByVal textBox As TextBox, _
       ByVal graphics As Graphics, _
       ByVal text As String, _
       ByVal foreColor As Color, _
       ByVal backColor As Color _
    ) 
    public static void DrawText( 
       TextBox textBox,
       Graphics graphics,
       string text,
       Color foreColor,
       Color backColor
    )

    Parameters

    textBox
    The System.Windows.Forms.TextBox in which the text is drawn.
    graphics
    The System.Drawing.Graphics object used to paint.
    text
    The text to be drawn.
    foreColor
    The foreground color of the text.
    backColor
    The background color of the text.
    Remarks
    This method is used to draw placeholder text or the text of a disabled text box.
    See Also