TabControl query

  • Thread starter Thread starter PatrickS
  • Start date Start date
P

PatrickS

I'm trying to develop an application that effectively has two parts to the
form. On the left you have a treeview with the various items listed. On the
right there are the details, with each screen contained within a tab in a
tabcontrol. The only way that the user should be switching from one tab to
another is when they select a different item on the treeview control.

Is there any way to hide the tabs at the bottom of the tab control whilst
still allowing for multiple tabpages within the tab control?
 
I'm trying to develop an application that effectively has two parts to the
form. On the left you have a treeview with the various items listed. On the
right there are the details, with each screen contained within a tab in a
tabcontrol. The only way that the user should be switching from one tab to
another is when they select a different item on the treeview control.

Is there any way to hide the tabs at the bottom of the tab control whilst
still allowing for multiple tabpages within the tab control?

not that I know of, what you can do is avoid the tabcontrol from
changing between tabpages.
 
Hi Patrick,

Create a subclass of TabControl to remove the Tabs. You should note though
that users will still be able to navigate via keyboard (Ctrl+Tab,
Ctrl+Shift+Tab, Arrow Keys, Home, End, Page Up and Page Down).

--- C# subclass ------------------------------------------------------------
public class WizardControl : TabControl
{
public WizardControl() : base()
{
base.Multiline = true;
}

protected override void WndProc(ref Message m)
{
if (m.Msg != TCM_ADJUSTRECT)
base.WndProc(ref m);
}

private const int TCM_FIRST = 0x1300;
private const int TCM_ADJUSTRECT = (TCM_FIRST + 40);

}
 
Back
Top