This is a migrated thread and some comments may be shown as answers.

Change colors in disabled mode

3 Answers 162 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
SupportTI
Top achievements
Rank 1
SupportTI asked on 15 Nov 2010, 08:01 PM
Hi,

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

3 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 16 Nov 2010, 10:37 AM
Hello,

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
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 17 Nov 2010, 12:44 PM
Hello,

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.

Thanks
Richard
0
Stefan
Telerik team
answered on 18 Nov 2010, 01:13 PM
Hi Richard,

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

Best wishes,
Stefan
the Telerik team
See What's New in RadControls for WinForms in Q3 2010 on Wednesday, November 17, 11am Eastern Time: Register here>>
Tags
MultiColumn ComboBox
Asked by
SupportTI
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or