ComponentOne Menus and Toolbars for WinForms
Menus and Toolbars for WinForms Task-Based Help / TopicBar Tasks / Customizing the Expand/Collapse Behaviors / Changing the Expand / Collapse Animation
In This Topic
    Changing the Expand / Collapse Animation
    In This Topic

    By default, the animation for the expand/collapse behavior of the C1TopicBar control is set to System, meaning that the behavior follows the settings of a user's operating system. If you'd rather have control over this, you can turn the animation on by setting to Animation property to On, or you can turn the animation off by setting the Animation to Off.

    Using the Properties Window

    Complete the following steps:

    1. Navigate to the Toolbox and double-click the C1TopicBar icon. The C1TopicBar control is added to the form. Observe that one page, named Page 1, appears on the control by default. If you'd like to add more pages to the control, see Adding Topic Pages to the TopicBar.
    2. Right-click the C1TopicBar control to open its context menu and then select Properties.
    3. The Properties window opens with the C1TopicBar control's properties in focus.
    4. Locate the Animation property, click its drop-down arrow, and select a setting from the list.

    Using Code

    Complete the following steps:

    1. Navigate to the Toolbox and double-click the C1TopicBar icon. The C1TopicBar control is added to the form. Observe that one page, named Page 1, appears on the control by default. If you'd like to add more pages to the control, see Adding Topic Pages to the TopicBar.
    2. Double-click the empty portion of the form to open Code view. Notice that a Form_Load event handler has been added to Code view.
    3. Import the following namespace into the project:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Imports C1.Win.C1Command
      

      To write code in C#

      C#
      Copy Code
      using C1.Win.C1Command;
      
    4. Complete ONE of the following:
      • To turn the animation on, add the following code to the Form_Load event

        To write code in Visual Basic

        Visual Basic
        Copy Code
        c1TopicBar1.Animation = C1AnimationEnum.On
        

        To write code in C#

        C#
        Copy Code
        c1TopicBar1.Animation = C1AnimationEnum.On
        
      • To turn the animation off, add the following code to the Form_Load event

        To write code in Visual Basic

        Visual Basic
        Copy Code
        c1TopicBar1.Animation = C1AnimationEnum.Off
        

        To write code in C#

        C#
        Copy Code
        c1TopicBar1.Animation = C1AnimationEnum.Off;
        
    5. Press F5 to build the project.
    See Also