Click here to Skip to main content
15,885,546 members
Articles / Programming Languages / C#

IPToolbox: A VS2005-like Toolbox

Rate me:
Please Sign up or sign in to vote.
4.90/5 (50 votes)
25 May 20074 min read 231.8K   7K   162  
A Visual Studio 2005-like ToolBox control which supports almost all features of the original: drag'n'drop, renaming, hiding tabs, items, and disabling items
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Text;

namespace IP.Components
{
    partial class Toolbox
    {
        /// <summary>
        /// Contains information about an area of a <see cref="Toolbox"/> control. 
        /// </summary>
        public sealed class HitTestInfo
        {
            private HitArea _hitArea;
            private Point _hitPoint;
            private IToolboxObject _hitTool;

            internal HitTestInfo(Point location) : this(location, HitArea.None, null)
            {
            }

            internal HitTestInfo(Point location, HitArea area, IToolboxObject tool)
            {
                _hitPoint = location;
                _hitArea = area;
                _hitTool = tool;
            }

            /// <summary>
            /// Gets the <see cref="Toolbox.HitArea"/> that represents the area of the toolbox evaluated by the hit-test operation.
            /// </summary>
            public HitArea HitArea
            {
                [DebuggerStepThrough]
                get { return _hitArea; }
                [DebuggerStepThrough]
                internal set { _hitArea = value; }
            }

            /// <summary>
            /// Gets the point that was hit-tested.
            /// </summary>
            public Point Location
            {
                [DebuggerStepThrough]
                get { return _hitPoint; }
            }

            /// <summary>
            /// Gets the <see cref="Tab"/> or the <see cref="Item"/> object that was hit if any.
            /// </summary>
            public IToolboxObject Tool
            {
                [DebuggerStepThrough]
                get { return _hitTool; }
                [DebuggerStepThrough]
                internal set { _hitTool = value; }
            }
        }
    }
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
I@n
Web Developer
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions