ComponentOne List for WinForms
In This Topic
    Three-Dimensional vs. Flat Display
    In This Topic

    List for WinForms supports a standard, "flat" control appearance, the more attractive three-dimensional appearance used by many controls, and a third that combines the flat appearance with the 3D. By default, the list's FlatStyle property is set to System so that the three-dimensional look is used. However, this property only controls whether three-dimensional effects are used to draw the list's border, caption bars, column headings and footings, and the record selector column. It does not affect the list's data cells or row and column dividers.

    The following appearance settings are available in List for WinForms:

    Standard Appearance

    When FlatStyle is set to Standard, the list looks like this:

    PopUp Appearance

    When FlatStyle is set to PopUp, the list looks like this:

    The initial list has the same appearance as when FlatStyle is set to Flat (see below). As the mouse moves over any control element, the appearance of that element takes on a 3D look.

    Flat Appearance

    When FlatStyle is set to Flat, the list looks like this:

    Three-Dimensional Appearance

    To achieve a three-dimensional appearance for the entire list, including its interior, set the following properties either in the designer or in code:

    1. In the Properties window, set the RowDivider style property to Inset. Or, in code:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1List1.RowDivider.Style = C1.Win.C1List.LineStyleEnum.Inset
      

      To write code in C#

      C#
      Copy Code
      this.c1List1.RowDivider.Style = C1.Win.C1List.LineStyleEnum.Inset;
      
    2. In the Splits Collection Editor, set the Style property to Inset for all ColumnDivider style objects for each split. Or, in code:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Dim C As C1.Win.C1List.C1DisplayColumn   
      For Each C In Me.C1List1.Splits(0).DisplayColumns
       C.ColumnDivider.Style = C1.Win.C1List.LineStyleEnum.Inset  
      Next C
      

      To write code in C#

      C#
      Copy Code
      C1.Win.C1List.C1DisplayColumn C;
      foreach (C in this.c1List1.Splits[0].DisplayColumns)
      {  
       C.ColumnDivider.Style = C1.Win.C1List.LineStyleEnum.Inset;
      }
      
    3. In the Properties window, set the Style.BackColor property to Medium Aquamarine. Or, in code:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1List1.Style.BackColor = System.Drawing.Color.MediumAquamarine
      

      To write code in C#

      C#
      Copy Code
      this.c1List1.Style.BackColor = System.Drawing.Color.MediumAquamarine;
      

    The list will look like this:

    Note that changing the Style property of the RowDivider object to Inset consumes an extra vertical pixel in each data row, resulting in fewer visible rows.

    You can experiment to achieve different three-dimensional effects using other color combinations and divider styles, as explained in the Borders and Dividing Lines section.