TextBox Style

2 posts, 0 answers
  1. zeng dongmei
    zeng dongmei avatar
    1 posts
    Member since:
    May 2010

    Posted 13 May 2010 Link to this post

       The TextBox's backcolor is the same no matter it's in editor state or readonly state, and i can't tell it's state from it's appreance.
    I want it's backcolor changes when it turns to readonly state. Is there any easy way to do this?

    Looking forward to your replay.

  2. Nikolay
    Nikolay avatar
    1805 posts

    Posted 19 May 2010 Link to this post

    Hi zeng dongmei,

    The easiest approach for your scenario is to use an extended RadTextBox:
    public class MyTextBox : RadTextBox
        protected override void OnReadOnlyChanged(EventArgs e)
            if (this.ReadOnly)
        private void SetColor(Color color)
            this.TextBoxElement.BackColor = color;
            this.TextBoxElement.Fill.BackColor = color;
            this.TextBoxElement.Border.ForeColor = color;
        public override string ThemeClassName
                return typeof(RadTextBox).FullName;

    Best wishes,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top