Change colors in disabled mode

4 posts, 0 answers
  1. SupportTI
    SupportTI avatar
    8 posts
    Member since:
    Feb 2010

    Posted 15 Nov 2010 Link to this post


    I have a WinForms application that works in 2 modes : Consultation and Modification. When my form is in Consultation mode, I need to set the Enabled property of the MultiColumn ComboBox to false. However, the look of the ComboBox must be the same (White Back COlor with Black text color).

    The problem is when I set the property enabled to false, I can't change the properties. The control always has grayish colors (text and border).

    How can I set the proper colors to my disabled MultiColumn Combo box?

    Thanks in advance

    Yves Thibodeau
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 16 Nov 2010 Link to this post


    Actually, I think there might be an easier way than to try and control the colour of a disabled control. When a control is disabled, it will always be grey. Instead, create your own MultiColumnComboBox as a user control and set a ReadOnly field. If the read only field is true, then you can catch the drop down opening event and stop it, making it effectively disabled and keeping the colour.

    Private Sub RadMultiColumnComboBox1_DropDownOpening(ByVal sender As System.Object, _
        ByVal args As System.ComponentModel.CancelEventArgs) Handles RadMultiColumnComboBox1.DropDownOpening
        args.Cancel = True
    End Sub

    hope that helps
  3. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 17 Nov 2010 Link to this post


    How did you get on with this? If it helped, please may I ask you to mark as answer so others can find teh solution too. If you need more help, please just let me know.

  4. Stefan
    Stefan avatar
    2911 posts

    Posted 18 Nov 2010 Link to this post

    Hi Richard,

    Thank you for the provided solution. Your Telerik points have been updated for the community effort.  

    Best wishes,
    the Telerik team
    See What's New in RadControls for WinForms in Q3 2010 on Wednesday, November 17, 11am Eastern Time: Register here>>
Back to Top