ComponentOne Windows 7 Control Pack for WinForms
Windows 7 Control Pack for WinForms Quick Starts / C1TaskbarButton Quick Start / Step 3 of 4: Using the Apply and Clear Methods
In This Topic
    Step 3 of 4: Using the Apply and Clear Methods
    In This Topic

    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:
    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:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      C1TaskbarButton1.JumpList.Apply()
      

      To write code in C#

      C#
      Copy Code
      c1TaskbarButton1.JumpList.Apply();
      
    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:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      C1TaskbarButton1.JumpList.ClearTasksAndCustomCategories()
      

      To write code in C#

      C#
      Copy Code
      c1TaskbarButton1.JumpList.ClearTasksAndCustomCategories();
      

    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.