You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.7 KiB
C#
78 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
/** 隐藏tabcontrol标签
|
|
* Apperarance 属性:Faltbuttons
|
|
* SizeMode属性:Fixed
|
|
* 各个TabPage的Text :空
|
|
* ItemSize : Width=0;Height=1
|
|
**/
|
|
namespace Mesnac.Controls.Default
|
|
{
|
|
[ToolboxBitmap(typeof(System.Windows.Forms.TabControl))]
|
|
public partial class MCTabControl : TabControl
|
|
{
|
|
#region 字段定义
|
|
|
|
private int _currentTabIndex = 0; //当前选项卡索引
|
|
private string _currentTabIndexName = String.Empty; //当前选项卡索引动画属性
|
|
|
|
#endregion
|
|
|
|
#region 构造方法
|
|
|
|
public MCTabControl()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public MCTabControl(IContainer container)
|
|
{
|
|
container.Add(this);
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 属性定义
|
|
|
|
/// <summary>
|
|
/// 当前选项卡索引
|
|
/// </summary>
|
|
public int CurrentTabIndex
|
|
{
|
|
get { return _currentTabIndex; }
|
|
set
|
|
{
|
|
_currentTabIndex = value;
|
|
if (_currentTabIndex < this.TabPages.Count)
|
|
{
|
|
this.SelectedIndex = this._currentTabIndex;
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 动画属性
|
|
|
|
/// <summary>
|
|
/// 当前
|
|
/// </summary>
|
|
public string CurrentTabIndexName
|
|
{
|
|
get { return _currentTabIndexName; }
|
|
set { _currentTabIndexName = value; }
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|