views:

55

answers:

2

Hi,

Does anyone know how to colour the editor part (where you can type in the date) for the UltraCalendarCombo (winforms one) programmatically (i.e. without using the Style Library files)?

I want to set the background to a different colour whenever the control has focus but can't find any properties or methods to do this.

Thanks

+2  A: 

If I understand you correctly, I believe you can do it one of 2 ways...

// Directly via the BackColor property
ultraCalendarCombo1.BackColor = Color.Blue;

// Using an Appearance object
ultraCalendarCombo1.Appearance = new Infragistics.Win.Appearance { BackColor = Color.Blue };
Steve Dignan
That changes the whole colour of the control (i.e. the editor part and the drop down).I've actually figured it out and will post the answer.
Daisuke Shimamoto
A: 

I've actually figure this one out.

Steve's answer colours the editor part and the drop down part as well. You need to apply other Appearance properties as well.

// This is a copy from Steve's answer
// Directly via the BackColor property
ultraCalendarCombo1.BackColor = Color.Blue;

// Using an Appearance object
ultraCalendarCombo1.Appearance
    = new Infragistics.Win.Appearance { BackColor = Color.Blue };

// Now we set the drop down part to a different colour (Let's say white)
ultraCalendarCombo1.DropDownApperance
    = new Infragistics.Win.Appearance { BackColor = Color.White };

I believe you can do it by creating .isl (Infragistics Style Library) files but I wasn't quite sure how to swap these in and out programmatically.

Daisuke Shimamoto