Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MultyPagePanel : Panel
- {
- private int _currentPageIndex;
- public int CurrentPageIndex
- {
- get { return _currentPageIndex; }
- set
- {
- if (value >= 0 && value < (Controls.Count - 1))
- {
- Controls[value].BringToFront();
- _currentPageIndex = value;
- }
- }
- }
- public void AddPage(Control page)
- {
- Controls.Add(page);
- page.Dock = DockStyle.Fill;
- }
- }
- MultyPagePanel p;
- // MyTabPage is a Control derived class that represents one page on your form.
- MyTabPage page = new MyTabPage();
- p.AddPage(page);
- p.CurrentPageIndex = 0;
- using System;
- using System.Windows.Forms;
- class TablessControl : TabControl {
- protected override void WndProc(ref Message m) {
- // Hide tabs by trapping the TCM_ADJUSTRECT message
- if (m.Msg == 0x1328 && !DesignMode) m.Result = (IntPtr)1;
- else base.WndProc(ref m);
- }
- }
- tcActionControls.Region = new Region(new RectangleF(
- tbPageToShow.Left,
- tbPageToShow.Top,
- tbPageToShow.Width,
- tbPageToShow.Height)
- );
- public partial class TabControlWithoutHeader: TabControl
- {
- public TabControlWithoutHeader()
- {
- InitializeComponent();
- }
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == 0x1328 && !DesignMode)
- m.Result = (IntPtr)1;
- else
- base.WndProc(ref m);
- }
- }
Add Comment
Please, Sign In to add comment