using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Drawing.Extended;

namespace WheelchairControl
{
    /// <summary>
    /// Tab control with invisible bookmarks.
    /// </summary>
    /// <see cref="http://www.csharpque.com/2012/06/creating-wizard-using-c-form-tab.html"/>
    [ToolboxBitmap(typeof(TabControl))]
    public sealed class WizardTabControl : TabControl
    {
        /// <summary>
        /// System TCM_ADJUCTREST message code.
        /// </summary>
        private Int32 TCM_ADJUSTRECT_MSG_CODE = 0x1328;

        /// <summary>
        /// Override TabControl's WndProc routine to catch and discard TCM_ADJUSTRECT messages to prevent bookmarks from being drawn.
        /// </summary>
        /// <param name="m">Reference to windows system message.</param>
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == TCM_ADJUSTRECT_MSG_CODE && !DesignMode) //Discard TCM_ADJUSTRECT message, process all other messages in base class
                m.Result = IntPtr.Zero;
            else
                base.WndProc(ref m);
        } 
    
    }
}