Click here to Skip to main content
15,896,335 members
Articles / Programming Languages / C#

The Code Project Browser Add-in for Visual Studio 2005 and 2008

Rate me:
Please Sign up or sign in to vote.
4.90/5 (108 votes)
27 Mar 2008CPOL9 min read 317.8K   5K   296  
An add-in for browsing, downloading and managing CodeProject samples directly in Visual Studio
//  Copyright (c) 2007, SlickEdit, Inc
//  Email:  info@slickedit.com
//  All rights reserved.
//
//  Redistribution and use in source and binary forms, with or without modification, 
//  are permitted provided that the following conditions are met:
//
//  Redistributions of source code must retain the above copyright notice, 
//  this list of conditions and the following disclaimer. 
//  Redistributions in binary form must reproduce the above copyright notice, 
//  this list of conditions and the following disclaimer in the documentation 
//  and/or other materials provided with the distribution. 
//
//  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
//  PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER 
//  REMAINS UNCHANGED.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace CPBrowser
{
    /// <summary>
    /// This user control is used in the top right corner of the sidebar controls.
    /// </summary>
    public partial class CloseButton : UserControl
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public CloseButton()
        {
            InitializeComponent();
            // initialize the close button picture
            PictureCtl.Image = ImageListCtl.Images[0];
        }

        /// <summary>
        /// Handles the image switch when the mouse enters the button's area.
        /// </summary>
        private void PictureCtl_MouseEnter(object sender, EventArgs e)
        {
            PictureCtl.Image = ImageListCtl.Images[1];
        }

        /// <summary>
        /// Handles the image switch when the mouse leaves the button's area
        /// </summary>
        private void PictureCtl_MouseLeave(object sender, EventArgs e)
        {
            PictureCtl.Image = ImageListCtl.Images[0];
        }

        /// <summary>
        /// Propogates the Click event from the picture control to the host of this user
        /// control.
        /// </summary>
        private void PictureCtl_Click(object sender, EventArgs e)
        {
            // raise the OnClick event
            OnClick(new EventArgs());
        }

    }
}

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
Web Developer
United States United States
SlickEdit Inc. provides software developers with multi-language development tools and the most advanced code editors available. Power programmers, from Fortune 500 companies to individuals, have chosen SlickEdit as their development tool of choice for over 19 years. Proven on Windows, Linux, UNIX, and Mac OS X platforms, SlickEdit products enable even the most accomplished developers to write more code faster, and more accurately. For more information about SlickEdit and free trial downloads, please visit http://www.slickedit.com.
This is a Organisation

1 members

Comments and Discussions