Docking Tab for WinForms | ComponentOne
In This Topic
    Appearance and Styling
    In This Topic

    DockingTab includes a variety of appearance properties to visually enhance and customize the control. The control's tab style, size, and layout can easily be customized through the DockingTab's appearance properties. These properties can be set at design time through the Properties window or code. Users can also set a particular style for docking the tabs in the Command Dock as well.

    In the sub-sections, we will learn about the different appearance and styling properties for Docking Tab.

    Appearance

    Users can enhance the appearance of the DockingTab by changing properties such as BackColor, BackgroundImage, BackgroundImageLayout, BorderStyle, Font settings, TabAreaBackColorTabAreaBorder etc. in the Properties window.

    The snapshot below depicts the DockingTab control with these appearance properties.

    DockingTab with green background

    You can also enhance the appearance of the DockingTab control using the code snippet given below:

    C#
    Copy Code
    // Styling DockingTab
    dockingTab.BackColor = Color.DarkSeaGreen;
    dockingTab.BackgroundImage = Image.FromFile(@"resources\icon.png");
    dockingTab.BorderStyle = BorderStyle.Fixed3D;
    dockingTab.Font = new System.Drawing.Font("Segoe UI", 9F, ((System.Drawing.FontStyle)(((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic)
                     | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point);
    // Styling Tab
    dockingTab.TabAreaBackColor = System.Drawing.Color.Bisque;
    dockingTab.TabAreaBorder = true;
    // Styling DockingTabPage
    dockingTabPage.TabBackColor = Color.AliceBlue;
    dockingTabPage.ForeColor = Color.SlateBlue;
    

    Docking Styles

    When the DockingTab control is placed in the CommandDock component (see Enabling DockingTab Docking and Floating), it becomes a dock-able control. You can select a specific style for docking by setting the DockingStyle property of C1CommandDock class to Default, VS2005, VS2008, VS2010 or VS2012. The Default setting shows a gray shaded outline to illustrate where the control will be docked when you release the cursor, whereas VS2005, VS2008, VS2010 and VS2012 mimic the docking style of Visual Studio 2005, Visual Studio 2008, Visual Studio 2010 and Visual Studio 2012 respectively.

    The table below provides an example of each docking style.

    Docking Style

    Snapshot

    Default DockingTab with default style
    VS2005 DockingTab with VS2005 style
    VS2008 DockingTab with VS2008 style
    VS2010 DockingTab with VS2010 style
    VS2012 DockingTab with VS2012 style