Click here to Skip to main content
15,896,478 members
Articles / Programming Languages / Visual Basic

Windows 7 new features: Step by step in VB.NET and C#

Rate me:
Please Sign up or sign in to vote.
4.85/5 (88 votes)
31 Aug 2010CPOL9 min read 180K   4.7K   211  
Explaining all the new must have features in Windows 7 to make your application look shiny and professional, like the new features of the task bar and more.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsAPICodePack.Shell;
using Microsoft.WindowsAPICodePack.Taskbar;

namespace Win7NewFeatures.Taskbar
{
    public partial class frmIconOverlays : Form
    {
        public frmIconOverlays()
        {
            InitializeComponent();

        }

        private void frmIconOverlays_Load(object sender, EventArgs e)
        {
            this.cmbIcon.Items.AddRange(Enum.GetNames(typeof(StockIconIdentifier)));
            this.cmbIconSize.Items.AddRange(Enum.GetNames(typeof(StockIconSizes)));
        }

        private void btnClearIcon_Click(object sender, EventArgs e)
        {
            TaskbarManager.Instance.SetOverlayIcon(this.Handle, null, "");
        }

        private void chkLink_CheckedChanged(object sender, EventArgs e)
        {
            this.SetIconOverlay();
        }

        private void chkSelected_CheckedChanged(object sender, EventArgs e)
        {
            this.SetIconOverlay();
        }

        private void cmbIcon_TextChanged(object sender, EventArgs e)
        {
            this.SetIconOverlay();
        }

        private void cmbIconSize_TextChanged(object sender, EventArgs e)
        {
            this.SetIconOverlay();
        }

        public void SetIconOverlay()
        {
            if (!((this.cmbIcon.Text == null) | (this.cmbIconSize.Text == null)))
            {
                StockIconIdentifier ID = (StockIconIdentifier) (Enum.Parse(typeof(StockIconIdentifier), this.cmbIcon.Text));
                StockIconSizes Size = (StockIconSizes) (Enum.Parse(typeof(StockIconSizes), this.cmbIconSize.Text, true));
                StockIcon SelectedIcon = new StockIcon(ID, Size, this.chkLink.Checked, this.chkSelected.Checked);
                TaskbarManager.Instance.SetOverlayIcon(this.Handle, SelectedIcon.Icon, "hihi");
            }
        }



    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Software Developer IDS
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions