# Changing the Expand / Collapse Animation

Get started with Menus and Toolbars for WinForms. Create versatile menus and docking/floating toolbars. See more in documentation here.

## Content



By default, the animation for the expand/collapse behavior of the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) 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](/componentone/docs/win/online-menus-toolbar/) property to **On**, or you can turn the animation off by setting the [Animation](/componentone/docs/win/online-menus-toolbar/) to **Off**.

### Using the Properties Window

Complete the following steps:

1.  Navigate to the Toolbox and double-click the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) icon. The [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) 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](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsforw2/topicbartasks/addingandremovingtop/addingtopicpagestoth).
2.  Right-click the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control to open its context menu and then select **Properties**.
3.  The Properties window opens with the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control's properties in focus.
4.  Locate the [Animation](/componentone/docs/win/online-menus-toolbar/) 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](/componentone/docs/win/online-menus-toolbar/) icon. The [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) 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](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsforw2/topicbartasks/addingandremovingtop/addingtopicpagestoth).
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:
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    Imports C1.Win.C1Command
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    using C1.Win.C1Command;
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
4.  Complete ONE of the following:
    *   To turn the animation on, add the following code to the **Form\_Load** event
        
        DOC-DETAILS-TAG-OPEN
        
        DOC-SUMMARY-TAG-OPEN
        
        To write code in Visual Basic
        
        DOC-SUMMARY-TAG-CLOSE
        
        ```vbnet
        c1TopicBar1.Animation = C1AnimationEnum.On
        ```
        
        DOC-DETAILS-TAG-CLOSE
        
        DOC-DETAILS-TAG-OPEN
        
        DOC-SUMMARY-TAG-OPEN
        
        To write code in C#
        
        DOC-SUMMARY-TAG-CLOSE
        
        ```csharp
        c1TopicBar1.Animation = C1AnimationEnum.On
        ```
        
        DOC-DETAILS-TAG-CLOSE
        
    *   To turn the animation off, add the following code to the **Form\_Load** event
        
        DOC-DETAILS-TAG-OPEN
        
        DOC-SUMMARY-TAG-OPEN
        
        To write code in Visual Basic
        
        DOC-SUMMARY-TAG-CLOSE
        
        ```vbnet
        c1TopicBar1.Animation = C1AnimationEnum.Off
        ```
        
        DOC-DETAILS-TAG-CLOSE
        
        DOC-DETAILS-TAG-OPEN
        
        DOC-SUMMARY-TAG-OPEN
        
        To write code in C#
        
        DOC-SUMMARY-TAG-CLOSE
        
        ```csharp
        c1TopicBar1.Animation = C1AnimationEnum.Off;
        ```
        
        DOC-DETAILS-TAG-CLOSE
        
5.  Press F5 to build the project.

## See Also

[Creating a Collapsed Topic Page](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsforw2/topicbartasks/customizingtheexpand/creatingacollapsedto)