DisabledForeColor and BackColor in C1TextBox

Posted by: olkasu on 27 September 2017, 9:14 pm EST

    • Post Options:
    • Link

    Posted 27 September 2017, 9:14 pm EST

    Hi Guys,

    If I change color in DisabledForeColor then BackColor of control sets in Grey.

    In documentation I can’t find any information about this property. So the question:

    Is it bug or it should be like this?

    in attached picture: textbox2 has DisabledForeColor =Color.Red

    Thanks

  • Posted 27 September 2017, 9:14 pm EST

    Hi,

    This is By-Design behavior.

    When the MS-TextBox’s ‘Enabled’ property is set to false, its BackColor changes to Grey by default indicating that the control is not editable. And since C1TextBox inherits MS-Textbox it also shows the same behavior. Please refer to attached image.

    On setting the ‘DisabledForeColor’ property, the same behaviour is observed showing that the C1TextBox is disabled and its ForeColor is changed.

    However, you may change the ‘BackColor’ to say, ‘Transparent’/‘Window’ to give it a look of a normal TextBox.

    A sample application implementing the above has been attached for your reference.

    Regards,

    Ruchir Agarwal

    2017/06/prj_C1TextBox_ColorIssue.zip

  • Posted 27 September 2017, 9:14 pm EST

    Thanks, Ruchir Agarwal

    But when DisabledForeColor isn’t changed and C1textBox “Enabled” =false,

    then backcolor is white not grey, only forecolor becomes lightgrey.

  • Posted 27 September 2017, 9:14 pm EST

    Hello,

    We could not observe the same behavior at our end using the latest build version “4.0.20171.248”. When C1TextBox’s ‘DisabledForeColor’ isn’t changed and “Enabled” is set to false, then ‘BackColor’ appears grey. Please refer to attached screen-shot showing the behavior.

    Could you please verify the behavior of the attached application at your end too and share your observations. Also, what C1 build version are you using?

    Thanks,

    Ruchir Agarwal

    2017/06/prj_C1TextBox_ColorIssue1.zip

  • Posted 27 September 2017, 9:14 pm EST

    Thank Ruchir Agarwal

    I’ve found where the bug is. By default c1textbox has backcolor= SystemColors.Window, if I change this property for example backcolor= White, enabled =false => backcolor does not became grey, it is still white. Then I try to set this backcolor = SystemColors.Window, but I can’t. Only what can I do I should find this.c1TextBox2.BackColor = System.Drawing.Color.White and delete it. And then everything works fine.

    The question: if I change backcolor and want in disabled mode have backcolor grey what should I do?

    Thanks.

  • Posted 27 September 2017, 9:14 pm EST

    Hello,

    We could observe the issue at our end too and hence have forwarded it to the concerned team {Tracking ID: 268828}. We will update this thread once we get any information from them.

    However as workaround for setting the BackColor to grey when C1TextBox is disabled (after having changed the BackColor), you may change the BackColor of the control to SystemColors.Control as follow:

    [csharp] if (c1TextBox1.BackColor.Name != “Window” && c1TextBox1.Enabled == false)

    {

    c1TextBox1.BackColor = SystemColors.Control;

    }[/csharp]

    We have attached a sample application for your reference.

    Thanks & Regards,

    Ruchir Agarwal

    2017/06/prj_C1TextBox_BackColorIssue_modified.zip

  • Posted 14 November 2017, 6:54 am EST

    Hi!

    The issue has been fixed in the latest build of 2017 V3. And, you can update using C1Live.

    Regards,

    Meenakshi

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels