TabControl query

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

Ignacio Machin ( .NET/ C# MVP )

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.
 
M

Mick Doherty

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);

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top