Click here to Skip to main content
15,884,085 members
Articles / Programming Languages / Visual Basic

Windows 7 Features Controls

Rate me:
Please Sign up or sign in to vote.
4.97/5 (16 votes)
24 Feb 2012CPOL2 min read 29.8K   2.3K   31   4
The Windows 7 New Features Controls

Before you even download these files, it might be useful to read this article.

Introduction

I loved the Windows 7 New Features article, but I didn't liked that I had to enter all the code of those ToolbarThumbnailButtons, so I decided to create those controls by myself. It worked: I created a:

  • Extend Aero Component
  • Jumplist Component
  • Overlay Icon Component
  • Taskbar ProgressBar Component
  • Thumbnail Toolbar Component

NEVER USE CONTROLS OF THE SAME Windows 7 Features Controls IN THE SAME FORM!

Using the code

If you added the components to your form and set the properties, you have to call the

Private Sub TestForm_Shown(sender As System.Object, e As System.EventArgs) Handles MyBase.Shown
    ExtendAeroComponent1.SetAero(Me) '(+2 overloads)
    JumplistButtons1.SetJumplist() 'OR JumplistButtons1.AddJumplistLink(<Path>, <Title>, <Icon>)
    OverlayIcon1.SetIconOverlay(Me) '(+2 overloads)
    TaskbarProgressBar1.SetTaskbarProgressBar(Me) '(+1 overload)
    ThumbNailToolbar1.SetThumbnailToolbarButtons(Me)
End Sub

As you saw you have to call a sub in the MyBase.Shown event.

Extend Aero

ExtendAero.png

You can set the Aero properties at the design mode or in code, but always have to call ExtendAero1.SetAero to set the aero glass.

You can also call ExtendAero1.SetAero(Me, True) OR ExtendAero1.SetAero(Me, 50, 50, 50, 50) to set all the aero extensions to 50.

Jumplists

Jumplists.png

Jumplists. I'm sure you'll know something about these. Even Visual Studio 2010 uses them! So how do you use this control?

If you set the properties (the Images property was a bit difficult for me, so if there any suggestions...) you have to call JumplistButtons1.SetJumplist(). This will set everything in the jumplist. Make sure that if you add three JumplistLinks, you add three PathList and Images too!

You can also call: JumplistButtons1.AddJumplistLink(<Path>, <Title>, <Icon>)

Windows will remember the jumplist for the following time the program runs. To clear the jumplist, call JumplistButtons1.ClearJumplist()

Overlay Icons

Perhaps you don't know these, but here I'll show you:

Overlap.png

You can see a little start hovered logo. This works with other icons too.

As usual, you have to call OverlayIcon1.SetIconOverlay(Me) OR OverlayIcon1.SetIconOverlay(Me, <IconLocation>) OR OverlayIcon1.SetIconOverlay(Me, <Icon>)

TaskbarProgressBar

I'm sure you have seen this before in a file copy/move/etc. in Explorer.

Progressbar.png

To use this, you can use TaskbarProgressBar1.SetTaskbarProgressBar(Me) OR TaskbarProgressBar1.SetTaskbarProgressBar(Me, <CurrentValue>, <CurrentMaximum>, <ProgressState>)

ThumnailToolbar

ThumbNailTB.png

You can use maximum seven ThumbnailToolbarButtons.

If you have set all the properties you have to call ThumbNailToolbar1.SetThumbnailToolbarButtons(Me).

To use one of the events of these buttons, use the following code:

 Dim WithEvents TTB1 As Microsoft.WindowsAPICodePack.Taskbar.ThumbnailToolbarButton
Private Sub TestForm_Shown(sender As System.Object, e As System.EventArgs) Handles MyBase.Shown
    ThumbNailToolbar1.SetThumbnailToolbarButtons(Me)
    TTB1 = ThumbNailToolbar1.TTB1
End Sub

Private Sub TTB1_Click() Handles TTB1.Click
    MessageBox.Show("Hello world")
End Sub

References

If you use any of the controls into your project, add a reference to the DLL files in the DLL zip file:

  • Microsoft.WindowsAPICodePack.dll
  • Microsoft.WindowsAPICodePack.Shell.dll
and import
  • Imports Microsoft.WindowsAPICodePack.Shell
  • Imports Microsoft.WindowsAPICodePack.Taskbar
  • (These two are not required, but it saves a lot of time.)

Remember

NEVER USE CONTROLS OF THE SAME Windows 7 Features Controls IN THE SAME FORM!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
AnswerGood Work Pin
KillBot Project28-Sep-13 16:15
professionalKillBot Project28-Sep-13 16:15 
GeneralMy vote of 5 Pin
Member 809895416-Jan-13 12:24
Member 809895416-Jan-13 12:24 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey19-Mar-12 19:36
professionalManoj Kumar Choubey19-Mar-12 19:36 
SuggestionNice job Pin
The Mighty Atom16-Mar-12 8:38
The Mighty Atom16-Mar-12 8:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.