With editing Tabcontrol in c#?

Asked

Viewed 73 times

0

I intend to hide only the part of TabControl that comes the name of the tabpage in C#, as image below.

inserir a descrição da imagem aqui

It is possible?

2 answers

3

If you don’t want the tabs to appear, you’re probably using the wrong component.

The TabControl serves exactly to provide tabs.

Instead of TabControl, consider using a Panel. You can find the class documentation Panel here.

1

The easiest way, and that can be done by the control properties is as follows:

tabControl1.Appearance = TabAppearance.FlatButtons;
tabControl1.ItemSize = new Size(0, 1);
tabControl1.SizeMode = TabSizeMode.Fixed;

If this doesn’t solve your problem then you will have to create a custom control. Add a class to your project with the following code:

using System;
using System.Windows.Forms;

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

Compile the project. At the top of Toolbar a new control should appear. Drag it to the screen and use normally as the default Tabcontrol. When running the application the tabs will not be created

Browser other questions tagged

You are not signed in. Login or sign up in order to post.