How to Customize DateTimeInput, DoubleInput, IntegerInput and TextBoxX colors

Colors customization for all controls in DotNetBar is done through Office2007ColorTable. Following code shows how to customize border color for input controls:

private void CustomizeColors()
{
    Office2007Renderer renderer = GlobalManager.Renderer as Office2007Renderer;
    if (renderer == null) return;
    Office2007ColorTable table = renderer.ColorTable;
 
    // TextBoxX colors
    ElementStyle style = (ElementStyle)table.StyleClasses[ElementStyleClassKeys.TextBoxBorderKey];
    style.BorderColor = Color.Red;
 
    // DateTimeInput, DoubleInput and IntegerInput Colors
    style = (ElementStyle)table.StyleClasses[ElementStyleClassKeys.DateTimeInputBackgroundKey];
    style.BorderColor = Color.Green;
 
    // Stand-alone ComboBoxEx colors
    Office2007ComboBoxColorTable comboColors = table.ComboBox;
    comboColors.DefaultStandalone.Border = Color.Goldenrod;
}

C#:

赞(0)
未经允许不得转载:TaKaSa » How to Customize DateTimeInput, DoubleInput, IntegerInput and TextBoxX colors