Archive Browser
Download Cyotek.Windows.Forms.TabList.zip version 1.0.0.2, last updated 31/12/2012 (152.27 KB)
Download- md5: fbf021a18c325e7384b409ad256a9207
 
using System;
using System.Windows.Forms;
namespace Cyotek.Windows.Forms.Demo
{
  public partial class MainForm : Form
  {
    #region  Public Constructors
    public MainForm()
    {
      InitializeComponent();
    }
    #endregion  Public Constructors
    #region  Protected Overridden Methods
    protected override void OnLoad(EventArgs e)
    {
      base.OnLoad(e);
      selectionPropertyGrid.SelectedObject = tabList.SelectedPage;
      viewsTabList.SelectedPage = pageTabListPage;
    }
    #endregion  Protected Overridden Methods
    #region  Event Handlers
    private void addPageButton_Click(object sender, EventArgs e)
    {
      TabListPage page;
      page = tabList.TabListPages.Add("test");
    }
    private void removePageButton_Click(object sender, EventArgs e)
    {
      TabListPage page;
      page = tabList.SelectedPage;
      if (page != null)
        tabList.TabListPages.Remove(page);
    }
    private void tabList_SelectedIndexChanged(object sender, EventArgs e)
    {
      selectionPropertyGrid.SelectedObject = tabList.SelectedPage;
    }
    #endregion  Event Handlers
    private void firstButton_Click(object sender, EventArgs e)
    {
      this.SelectTab(0);
    }
    private void lastButton_Click(object sender, EventArgs e)
    {
      this.SelectTab(tabList.TabListPageCount - 1);
    }
    private void previousButton_Click(object sender, EventArgs e)
    {
      this.SelectTab(tabList.SelectedIndex - 1);
    }
    private void nextButton_Click(object sender, EventArgs e)
    {
      this.SelectTab(tabList.SelectedIndex + 1);
    }
    private void SelectTab(int index)
    {
      if (index < 0)
        index = 0;
      else if (index > tabList.TabListPageCount - 1)
        index = tabList.TabListPageCount - 1;
      tabList.SelectedIndex = index;
    }
  }
}
Donate
This software may be used free of charge, but as with all free software there are costs involved to develop and maintain.
If this site or its services have saved you time, please consider a donation to help with running costs and timely updates.
Donate