# Step 3 of 4: Using the Apply and Clear Methods

## Content



In the last step you created the jump list, but you still have to apply the jump list. In this step, you'll also learn how to clear jump lists.

Complete the following steps:

1.  Navigate to the Toolbox and add two **Button** controls to your form. These will generically be named **button1** and **button2**.
2.  Set **button1**'s **Text** property to "Activate Jump List".
3.  Set **button2**'s **Text** property to "Clear Jump List".
4.  Adjust the buttons on the form so that the text isn't clipped. The should look a little like this:<br />![](https://cdn.mescius.io/document-site-files/images/88084ada-ce7b-4ec0-9f66-d851989d7cf2/imagesext/image13_6.png)
5.  In Design view, double-click the **Activate Jump List** button to add the **button1\_Click** event handler and then add the following code to it:
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    C1TaskbarButton1.JumpList.Apply()
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    c1TaskbarButton1.JumpList.Apply();
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
6.  In Design view, double-click the **Clear Jump List** button to add a **button2\_Click** event handler and then add the following code to it:
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    C1TaskbarButton1.JumpList.ClearTasksAndCustomCategories()
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    c1TaskbarButton1.JumpList.ClearTasksAndCustomCategories();
    ```
    
    DOC-DETAILS-TAG-CLOSE
    

### What You've Accomplished

In this step, you added code to the project that will allow you to apply or clear the jump list at the click of a button. In the next step, you'll run the project and see the result of your work.