Input for WinForms | ComponentOne
Appearance and Styling / DbNavigator
In This Topic
    DbNavigator
    In This Topic

    Input provides various properties for styling the DbNavigator control, so that you can generate the Input DbNavigator as per your requirement and change the look and feel of the application you are creating.

    The C1DbNavigator class provides the BackColor and ForeColor properties to set the background and foreground colors, respectively. Besides these, it also provides the Styles property to apply styling to different states of DbNavigator such as Default, Disabled, Hot, HotPressed, and Pressed.. The Styles property inherits its attributes from the classes of the C1.Win.Input.DbNavigator.Styles namespace. These classes and their purposes are briefed in the table below:

    Styling classes Description
    DbNavigatorStyles  Contains display attributes that determine the appearance of control.
    NavBaseCustomStyle  Represents the custom styles of the navigation item.
    NavBaseStyle 
    Represents the styles of the navigation element.
    NavButtonCustomStyle  Represents the custom styles of the button item.
    NavButtonStyle  Represents the styles of the button element.
    NavCommonStyle  Represents the styles for the DbNavigator control which contains display attributes that determine the general appearance of the control on the screen.
    NavContentCustomStyle  Represents the custom styles of the navigation content item.
    NavContentStyle  Represents the styles of the navigation content element.
    NavEditorCustomStyle  Represents the custom styles of the editor item.
    NavEditorStyle  Represents the styles of the editor item.
    NavStateCustomStyle  Represents the custom style for element in different state.
    NavStateStyle  Represents the style for element in different states.

    To apply styling to the DbNavigator control, use the following code. Here, we apply styling to the DbNavigator control and its elements by setting the background color, foreground color, font style, and border style.

    C#
    Copy Code
    //Style DbNavigator control
    c1DbNavigator1.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point);
    c1DbNavigator1.BackColor = Color.Tan;
    c1DbNavigator1.ForeColor = Color.DarkGreen;
    
    //Style elements of DbNavigator
    c1DbNavigator1.Styles.Button.Border = new C1.Framework.Thickness(2, 2, 2, 2);
    c1DbNavigator1.Styles.Button.Default.BackColor = System.Drawing.Color.Bisque;
    c1DbNavigator1.Styles.Button.Default.BorderColor = System.Drawing.Color.Red;
    c1DbNavigator1.Styles.Common.BackColor = System.Drawing.Color.AntiqueWhite;
    c1DbNavigator1.Styles.Common.Border = new C1.Framework.Thickness(2, 2, 2, 2);
    c1DbNavigator1.Styles.Common.BorderColor = System.Drawing.Color.Gray;
    c1DbNavigator1.Styles.Editor.Border = new C1.Framework.Thickness(2, 2, 2, 2);
    c1DbNavigator1.Styles.Label.BackColor = Color.LightGray;
    c1DbNavigator1.Styles.Label.BorderColor = Color.Black;