HomeActive Query Builder - HowTos and TroubleshootingUser Interface CustomizationHow to hide the "Main" tab?

1.1. How to hide the "Main" tab?

Using the .NET Edition with standard WinForms controls, you may hide the tabs with the following code:

TabControl tc = (TabControl) queryBuilder1.Tabs.GetControl();
tc.ItemSize = new Size(1,1);
tc.Top = tc.Top - tc.ItemSize.Height;
tc.Height = tc.Height + tc.ItemSize.Height;
tc.Region = new Region(new RectangleF(tc.TabPages[0].Left, tc.TabPages[0].Top, tc.TabPages[0].Width, tc.TabPages[0].Height + tc.ItemSize.Height));

Another way is to make a tab very wide and set its height to 1:

tc.Multiline = false;
tc.SizeMode = TabSizeMode.Fixed;
tc.ItemSize = new Size(2000, 1);

It works but not looking perfect. That's all we can do. Unfortunately the WinForms TabControl has no standard way to hide tabs.

Using the .NET Edition with DevExpress controls, use the following code:

XtraTabControl tc = (XtraTabControl) queryBuilder1.Tabs.GetControl();
tc.ShowTabHeader = DefaultBoolean.False;

This page was: Helpful | Not Helpful