Change NullText Color

3 posts, 0 answers
  1. Ole
    Ole avatar
    3 posts
    Member since:
    May 2008

    Posted 10 Sep 2013 Link to this post

    Is it possible to change the color of the NullText for a RadTextBox control?  For example, I'd like to have the NullText show as red and then if text is entered, show that as black.

    Thanks,
    Ole
  2. Dess
    Admin
    Dess avatar
    1605 posts

    Posted 13 Sep 2013 Link to this post

    Hello Ole,

    Thank you for contacting us.

    In order to achieve your goal, you may have a look at the following code snippet:
    public Form1()
    {
        InitializeComponent();
     
        this.radTextBox1.NullText = "Enter First name";
        this.radTextBox1.TextBoxElement.TextBoxItem.NullTextColor = Color.Red;
        this.radTextBox1.TextBoxElement.TextBoxItem.ForeColor = Color.Purple;
    }

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ole
    Ole avatar
    3 posts
    Member since:
    May 2008

    Posted 13 Sep 2013 Link to this post

    This is exactly what I was looking for.

    Thank you!
Back to Top