logo

C# 3.0 - Hide tabPages headers (C# .NET)
Aldo Liaks posted at Wednesday, May 14, 2008 5:20 AM

Hi guys,

Is this (see below) the best way to hide tabPages headers?

taken from: http://forums.microsoft.com/MSDN/ShowPost.aspx?PageIndex=1&SiteID=1&PageID=1&PostID=2501509

Thanks,

Aldo.

Add a new class to your project, paste the code shown below and build the project.  You can now drop the control from the top of the toolbox onto your form.  At design time, the control looks like a regular TabControl.  At run-time, you only see the pages.  Use the SelectedIndex property to step through the pages.

Code Block

using System;

using System.Windows.Forms;

 

public class WizardPages : TabControl

{

    protected override void WndProc(ref Message m)

    {

        // Hide tabs by trapping the TCM_ADJUSTRECT message

        if (m.Msg == 0x1328 && !DesignMode) m.Result = (IntPtr)1;

        else

           base.WndProc(ref m);

    }

         }

Reply    Reply Using Power Editor
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0

Didn't Find The Answer You Were Looking For?

EggHeadCafe has experts online right now that may know the answer to your question.  We pay them a bonus for answering as many questions as they can.  So, why not help them and yourself by becoming a member (free) and ask them your question right now?
Ask Question In Live Forum

If you have an OpenID and do not want to become a member of the EggHeadCafe forum, you can also sign on to Chat Chaos and post your question to our real time Silverlight chat application.
Ask Question In Chat Chaos










  $1000 Contest    [)ia6l0 iii - $228  |  Jonathan VH - $161  |  Huggy Bear - $135  |  F Cali - $95  |  egg egg - $94  |  more Advertise  |  Privacy  |   (c) 2010