ComponentOne Windows 7 Control Pack for WinForms
Windows 7 Control Pack for WinForms Task-Based Help / C1TaskbarButton Task-Based Help / Working with the Thumbnail Elements / Adding Thumbnail Buttons
In This Topic
    Adding Thumbnail Buttons
    In This Topic

    A C1TaskbarButton control will provide your application with a thumbnail that appears as the user hovers over the application's icon with his or her cursor. This thumbnail window can also contain buttons, such as a next/previous button, that allow users to interact with the application right from the Windows 7 toolbar. These buttons can be added at design time via a collection editor or at run time via code.

    In the Designer

    1. Open the C1Thumbnails.Buttons Collection Editor in one of the following ways:

    · Click the C1TaskbarButtons smart tag to open the C1TaskbarButton Tasks Menu and select Edit Thumbnail Buttons.

    OR

    · In the Properties window, expand the Thumbnail node and then, next to Items, click the ellipses button.

    2. In the C1Thumbnails.Buttons Collection Editor, click the Add button to add a button to the thumbnail.

    3. Set the properties in the properties grid.

    In Code

    To add one button to the thumbnail, create the C1ThumbButton and add it to the thumbnail via the Add method, such as in the following example:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim C1ThumbButton As New C1ThumbButton()
    C1TaskbarButton1.Thumbnail.Buttons.Add(C1ThumbButton)
    

    To write code in C#

    C#
    Copy Code
    C1ThumbButton c1ThumbButton = new C1ThumbButton();
    c1TaskbarButton1.Thumbnail.Buttons.Add(c1ThumbButton);
    

    To add two or more buttons to the thumbnail, create the C1ThumbButtons and add them to the thumbnail via the AddRange method, such as in the following example:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim C1ThumbButton1 As New C1ThumbButton()
    Dim C1ThumbButton2 As New C1ThumbButton()
    C1TaskbarButton1.Thumbnail.Buttons.AddRange(New C1.Win.C1Win7Pack.C1ThumbButton() {C1ThumbButton1, C1ThumbButton2})
    

    To write code in C#

    C#
    Copy Code
    C1ThumbButton C1ThumbButton1 = new C1ThumbButton();
    C1ThumbButton C1ThumbButton2 = new C1ThumbButton();
    c1TaskbarButton1.Thumbnail.Buttons.AddRange(new C1.Win.C1Win7Pack.C1ThumbButton[] {C1ThumbButton1,C1ThumbButton2});