📄 xtabcontrol.cs
字号:
get
{
if (this._drawer == null)
{
this._drawer = this.GetDrawer(this.XTabStyle);
}
return this._drawer;
}
}
[Browsable(true), Category("XControl"), Description("鼠标悬停于Tab上的时候是否显示ToolTip")]
public bool EnableToolTip
{
get
{
return this._enableToolTip;
}
set
{
this._enableToolTip = value;
}
}
[Description("是否在只有一个Tab的时候隐藏Tab"), Category("XControl"), DefaultValue(false), Browsable(true)]
public bool HideTabWhenOneTab
{
get
{
return this._hideTabWhenOneTab;
}
set
{
this._hideTabWhenOneTab = value;
}
}
[Browsable(true), Description("滑动时候的图片集合"), Category("XControl")]
public System.Windows.Forms.ImageList HoverImageList
{
get
{
if (this._hoverImageList == null)
{
this._hoverImageList = new System.Windows.Forms.ImageList();
}
return this._hoverImageList;
}
set
{
this._hoverImageList = value;
}
}
public int HoverIndex
{
get
{
return this._hoverIndex;
}
set
{
if (value == -1)
{
this.TabTip.RemoveAll();
}
this._hoverIndex = value;
}
}
[Browsable(true), Description("Tab处于悬停状态的背景颜色"), Category("XControl")]
public Color HoverTabBackColor
{
get
{
return this._hoverTabBackColor;
}
set
{
this._hoverTabBackColor = value;
}
}
[Browsable(true), Description("正常状态下的图片集和"), Category("XControl")]
public System.Windows.Forms.ImageList ImageList
{
get
{
if (this._imageList == null)
{
this._imageList = new System.Windows.Forms.ImageList();
}
return this._imageList;
}
set
{
this._imageList = value;
}
}
[Browsable(false)]
public bool MouseInRectA
{
get
{
return this._mouseInRectA;
}
internal set
{
this._mouseInRectA = value;
}
}
[Browsable(false)]
public bool MouseInRectB
{
get
{
return this._mouseInRectB;
}
internal set
{
this._mouseInRectB = value;
}
}
protected Queue<ScrollDirection> ScrollActions
{
get
{
if (this._scrollActions == null)
{
this._scrollActions = new Queue<ScrollDirection>();
}
return this._scrollActions;
}
}
public Image ScrollImageButton
{
get
{
if (this.ThemeEnabled)
{
return Style.ScrollImageButton;
}
return this._scrollImageButton;
}
set
{
this._scrollImageButton = value;
}
}
[Browsable(false)]
public Rectangle ScrollRectA
{
get
{
return this._scrollARect;
}
set
{
this._scrollARect = value;
}
}
[Browsable(false)]
public Rectangle ScrollRectB
{
get
{
return this._scrollBRect;
}
set
{
this._scrollBRect = value;
}
}
public int SelectedIndex
{
get
{
if ((this._selectedIndex == -1) && (this.tabPageCount > 0))
{
this._selectedIndex = 0;
}
return this._selectedIndex;
}
set
{
if (this._selectedIndex != value)
{
this._selectedIndex = value;
if (this.SelectedIndexChanged != null)
{
this.SelectedIndexChanged(this, EventArgs.Empty);
}
}
}
}
public XTabPage SelectedTab
{
get
{
return this.SelectedTabInternal;
}
set
{
this.SelectedTabInternal = value;
}
}
[Browsable(true), Category("XControl"), Description("选中的Tab背景色")]
public Color SelectedTabBackColor
{
get
{
return this._selectedTabBackColor;
}
set
{
this._selectedTabBackColor = value;
}
}
internal XTabPage SelectedTabInternal
{
get
{
int selectedIndex = this.SelectedIndex;
if (selectedIndex == -1)
{
return null;
}
return this.TabPages[selectedIndex];
}
set
{
int num = this.FindTabPage(value);
this.SelectedIndex = num;
}
}
[Category("XControl"), Browsable(true), DefaultValue(1), Description("滚动按钮的显示模式,功能没有完全实现,暂时实现了Auto模式")]
public Imps.Client.Pc.XControls.ShowScrollMode ShowScrollMode
{
get
{
return this._showScrollMode;
}
set
{
this._showScrollMode = value;
}
}
public static XTabContorlStyle Style
{
get
{
if (_style == null)
{
_style = new XTabContorlStyle();
}
return _style;
}
}
public object SyncRoot
{
get
{
return this._syncRoot;
}
}
public int TabCount
{
get
{
return this.tabPageCount;
}
}
[Browsable(true), Category("XControl"), DefaultValue(40), Description("Tab的高度")]
public int TabHeight
{
get
{
if ((this.ThemeEnabled && (this.Alignment == TabAlignment.Left)) && (this.XTabStyle == Imps.Client.Pc.XControls.XTabStyle.Msn))
{
return Style.TabHeight;
}
return this._tabHeight;
}
set
{
this._tabHeight = value;
}
}
public XTabPageCollection TabPages
{
get
{
return this._tabCollection;
}
}
public Rectangle TabRectangle
{
get
{
Rectangle empty = Rectangle.Empty;
if ((this.TabCount != 1) || !this.HideTabWhenOneTab)
{
switch (this.Alignment)
{
case TabAlignment.Top:
return new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width, this.TabHeight);
case TabAlignment.Bottom:
case TabAlignment.Right:
return empty;
case TabAlignment.Left:
return new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.TabWidth, this.ClientRectangle.Height);
}
}
return empty;
}
}
[DefaultValue(0x20), Browsable(true), Category("XControl"), Description("Tab的宽度")]
public int TabWidth
{
get
{
if (this.ThemeEnabled)
{
return Style.TabWidth;
}
return this._tabWidth;
}
set
{
this._tabWidth = value;
}
}
[Category("XControl"), Description("是否启用样式支持"), DefaultValue(true), Browsable(true)]
public bool ThemeEnabled
{
get
{
return this._themeEnabled;
}
set
{
this._themeEnabled = value;
}
}
internal int TickCounter
{
get
{
return this._tickCounter;
}
set
{
this._tickCounter = value;
}
}
public int UnHidedCount
{
get
{
int num = 0;
if (this.XTabStyle == Imps.Client.Pc.XControls.XTabStyle.Msn)
{
num = 1;
}
for (int i = 1; i < this.TabCount; i++)
{
num += this.TabPages[i].Hided ? 0 : 1;
}
return num;
}
}
public Rectangle XTabPageRectangle
{
get
{
Rectangle empty = Rectangle.Empty;
switch (this.Alignment)
{
case TabAlignment.Top:
return new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y + this.TabRectangle.Height, this.ClientRectangle.Width, this.ClientRectangle.Height - this.TabRectangle.Height);
case TabAlignment.Bottom:
case TabAlignment.Right:
return empty;
case TabAlignment.Left:
return new Rectangle(this.ClientRectangle.X + this.TabWidth, this.ClientRectangle.Y, (this.ClientRectangle.Width - this.TabWidth) - this.BorderWidth, this.ClientRectangle.Height);
}
return empty;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -