Thumbnail toolbar for Windows 7 taskbar Development (thumbnail toolbar)

Source: Internet
Author: User

In the previous article, we appliedProgramWe have set custom thumbnails. In this article, we will continue to develop the thumbnails and add the toolbar to them ). When you use Windows Media Player (WMP), place the cursor over the WMP icon and the thumbnail toolbar appears, this includes three function keys: "play", "Next", and "previous". You can select a song through the toolbar even if WMP is not in the current activity window. Next we will create a toolbar with the function of switching images.

 

 

Thumbnailbutton. thumbnailtoolbarbutton Method

Before creating a toolbar, use the thumbnailtoolbarbutton (icon, string tooltip) method to create four function buttons: "Next image", "previous image", and "last image ", "First image" and add their respective click events (for example, buttonfirst_click) for them to complete the image switching function, and then place these buttons in the toolbar.

 Thumbnailtoolbarbutton Buttonfirst = New  Thumbnailtoolbarbutton (
Win7taskbardemo. properties.Resources . First, "First image" ); Buttonfirst. Enabled = True ; Buttonfirst. Click + = buttonfirst_click; Thumbnailtoolbarbutton Buttonprevious = New Thumbnailtoolbarbutton (
Win7taskbardemo. properties. Resources . Previous, "Previous image" ); Buttonprevious. Enabled = True ; Buttonprevious. Click + = buttonprevius_click; Thumbnailtoolbarbutton Buttonnext = New Thumbnailtoolbarbutton (
Win7taskbardemo. properties. Resources . Next, "Next image" ); Buttonprevious. Enabled = True ; Buttonnext. Click + = buttonnext_click; Thumbnailtoolbarbutton Buttonlast = New Thumbnailtoolbarbutton (
Win7taskbardemo. properties. Resources . Last,"Last image" ); Buttonprevious. Enabled = True ; Buttonlast. Click + = buttonlast_click;

 

Thumbnailtoolbarmanager. addbuttons Method

For the addbuttons method, refer:

 
Public voidAddbuttons (IntptrWindowhandle,ParamsThumbnailtoolbarbutton[] Buttons );Public voidAddbuttons (UielementControl,ParamsThumbnailtoolbarbutton[] Buttons );

 

Put the four buttons in the toolbar. Note the order of the buttons:

Taskbarmanager. Instance. thumbnailtoolbars. addbuttons (NewWindowinterophelper(Application. Current. mainwindow). Handle, buttonfirst, buttonprevious, buttonnext, buttonlast );

 

Effect demonstration

As shown in, the function of the application itself is: "After you select an image in The ListBox, synchronously update the enlarged image above the ListBox ." If you place the cursor over the taskbar icon, you can see the thumbnail toolbar we just created. You can switch the image in the ListBox through the four buttons to achieve the same functional effect as the program.

 

References

1. Windows API code pack for. NET Framework

Http://code.msdn.microsoft.com/WindowsAPICodePack

2. thumbnail toolbars

Http://msdn.microsoft.com/en-us/library/dd378460 (vs.85). aspx # thumbbars

3. thumbnail preview for Windows 7 taskbar Development (thumbnail)

Http://www.cnblogs.com/gnielee/archive/2010/03/08/windows7-taskbar-thumbnail-preview.html

 

Source code Download

Contains all previous instances:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.