Tim Van Wassenhove home

A while ago i was thinking that i would be nice to have a control that exposes multiple designer panels, but only shows one at a timeā€¦ Somewhat like a TabControl, but without the header.. Anyway, i found out (here) that a TabControl can be tweaked into that behaviour

public class MultiPanel : TabControl
{
	protected override void WndProc(ref Message m)
	{
		if (m.Msg == 0x1328 && !DesignMode)
		{
			m.Result = (IntPtr) 1;
		}
		else
		{
			base.WndProc(ref m);
		}
	}
}

In the designer it appears as following

screenshot of MultiPanel at designtime

screenshot of MultiPanel at designtime

And at runtime it appears as following

screenshot of MultiPanel at designtime

screenshot of MultiPanel at designtime