Click here to Skip to main content
15,891,828 members
Articles / Desktop Programming / Windows Forms

ButtonBar Control using .NET

Rate me:
Please Sign up or sign in to vote.
4.95/5 (43 votes)
3 Dec 2009CPOL5 min read 64.8K   5.5K   104  
Themed ButtonBar control supporting custom draw with full Designer support
using System;

namespace ButtonBarsControl.Design.Generics
{
    /// <summary>
    /// Represents a method which can handle generic event with associated object.
    /// </summary>
    /// <typeparam name="T">Generic type which can be associated with the event.</typeparam>
    /// <param name="sender">Event source</param>
    /// <param name="tArgs">Object containing event data</param>
    public delegate void GenericEventHandler<T>(object sender, GenericEventArgs<T> tArgs);

    /// <summary>
    /// Class holding information related to generic event.
    /// </summary>
    /// <typeparam name="T">Generic type which can be associated with the event.</typeparam>
    public class GenericEventArgs<T> : EventArgs
    {
        /// <summary>
        /// Initializes new default instance.
        /// </summary>
        public GenericEventArgs()
        {
            Value = default(T);
        }

        /// <summary>
        /// Initializes new instance with specified parameter.
        /// </summary>
        /// <param name="value">Object to be associated with the event.</param>
        public GenericEventArgs(T value)
        {
            Value = value;
        }

        /// <summary>
        /// Object associated with the event.
        /// </summary>
        public T Value { get; set; }
    }
}

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 (Senior)
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions