?? tabcontrol.cs
字號:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual TabPageCollection TabPages
{
get { return _tabPages; }
}
[Category("Appearance")]
public override Font Font
{
get { return base.Font; }
set
{
if (value != null)
{
if (value != base.Font)
{
_defaultFont = (value == SystemInformation.MenuFont);
DefineFont(value);
_recalculate = true;
Invalidate();
}
}
}
}
private bool ShouldSerializeFont()
{
return !_defaultFont;
}
[Category("Appearance")]
public override Color ForeColor
{
get { return _textColor; }
set
{
if (_textColor != value)
{
_textColor = value;
_recalculate = true;
Invalidate();
}
}
}
private bool ShouldSerializeForeColor()
{
return _textColor != TabControl.DefaultForeColor;
}
[Category("Appearance")]
public override Color BackColor
{
get { return base.BackColor; }
set
{
if (this.BackColor != value)
{
_defaultColor = (value == SystemColors.Control);
DefineBackColor(value);
_recalculate = true;
Invalidate();
}
}
}
private bool ShouldSerializeBackColor()
{
return this.BackColor != SystemColors.Control;
}
[Category("Appearance")]
public virtual Color ButtonActiveColor
{
get { return _buttonActiveColor; }
set
{
if (_buttonActiveColor != value)
{
_buttonActiveColor = value;
DefineButtonImages();
}
}
}
private bool ShouldSerializeButtonActiveColor()
{
return _buttonActiveColor != Color.FromArgb(128, this.ForeColor);
}
public void ResetButtonActiveColor()
{
ButtonActiveColor = Color.FromArgb(128, this.ForeColor);
}
[Category("Appearance")]
public virtual Color ButtonInactiveColor
{
get { return _buttonInactiveColor; }
set
{
if (_buttonInactiveColor != value)
{
_buttonInactiveColor = value;
DefineButtonImages();
}
}
}
private bool ShouldSerializeButtonInactiveColor()
{
return _buttonInactiveColor != Color.FromArgb(128, this.ForeColor);
}
public void ResetButtonInactiveColor()
{
ButtonInactiveColor = Color.FromArgb(128, this.ForeColor);
}
[Category("Appearance")]
[DefaultValue(typeof(VisualAppearance), "MultiForm")]
public virtual VisualAppearance Appearance
{
get { return _appearance; }
set
{
if (_appearance != value)
{
SetAppearance(value);
Recalculate();
Invalidate();
}
}
}
public void ResetAppearance()
{
Appearance = VisualAppearance.MultiForm;
}
[Category("Appearance")]
[DefaultValue(typeof(VisualStyle), "IDE")]
public virtual VisualStyle Style
{
get { return _style; }
set
{
if (_style != value)
{
_style = value;
// Define the correct style indexer
SetStyleIndex();
Recalculate();
Invalidate();
}
}
}
public void ResetStyle()
{
Style = VisualStyle.IDE;
}
[Category("Behavour")]
public virtual PopupMenu ContextPopupMenu
{
get { return _contextMenu; }
set { _contextMenu = value; }
}
protected bool ShouldSerializeContextPopupMenu()
{
return _contextMenu != null;
}
public void ResetContextPopupMenu()
{
ContextPopupMenu = null;
}
[Category("Appearance")]
[DefaultValue(false)]
public virtual bool HotTrack
{
get { return _hotTrack; }
set
{
if (_hotTrack != value)
{
_hotTrack = value;
if (!_hotTrack)
_hotTrackPage = -1;
_recalculate = true;
Invalidate();
}
}
}
public void ResetHotTrack()
{
HotTrack = false;
}
[Category("Appearance")]
public virtual Color HotTextColor
{
get { return _hotTextColor; }
set
{
if (_hotTextColor != value)
{
_hotTextColor = value;
_recalculate = true;
Invalidate();
}
}
}
private bool ShouldSerializeHotTextColor()
{
return _hotTextColor != SystemColors.ActiveCaption;
}
public void ResetHotTextColor()
{
HotTextColor = SystemColors.ActiveCaption;
}
[Category("Appearance")]
public virtual Color TextColor
{
get { return _textColor; }
set
{
if (_textColor != value)
{
_textColor = value;
_recalculate = true;
Invalidate();
}
}
}
private bool ShouldSerializeTextColor()
{
return _textColor != TabControl.DefaultForeColor;
}
public void ResetTextColor()
{
TextColor = TabControl.DefaultForeColor;
}
[Category("Appearance")]
public virtual Color TextInactiveColor
{
get { return _textInactiveColor; }
set
{
if (_textInactiveColor != value)
{
_textInactiveColor = value;
_recalculate = true;
Invalidate();
}
}
}
private bool ShouldSerializeTextInactiveColor()
{
return _textInactiveColor != Color.FromArgb(128, TabControl.DefaultForeColor);
}
public void TextTextInactiveColor()
{
TextInactiveColor = Color.FromArgb(128, TabControl.DefaultForeColor);
}
[Browsable(false)]
public virtual Rectangle TabsAreaRect
{
get { return _tabsAreaRect; }
}
[Category("Appearance")]
public virtual ImageList ImageList
{
get { return _imageList; }
set
{
if (_imageList != value)
{
_imageList = value;
_recalculate = true;
Invalidate();
}
}
}
private bool ShouldSerializeImageList()
{
return _imageList != null;
}
public void ResetImageList()
{
ImageList = null;
}
[Category("Appearance")]
public virtual bool PositionTop
{
get { return _positionAtTop; }
set
{
if (_positionAtTop != value)
{
_positionAtTop = value;
_recalculate = true;
Invalidate();
}
}
}
protected bool ShouldSerializePositionTop()
{
switch(_appearance)
{
case VisualAppearance.MultiBox:
case VisualAppearance.MultiForm:
return _positionAtTop != false;
case VisualAppearance.MultiDocument:
default:
return _positionAtTop != true;
}
}
public void ResetPositionTop()
{
switch(_appearance)
{
case VisualAppearance.MultiBox:
case VisualAppearance.MultiForm:
PositionTop = false;
break;
case VisualAppearance.MultiDocument:
default:
PositionTop = true;
break;
}
}
[Category("Appearance")]
public virtual bool ShowClose
{
get { return _showClose; }
set
{
if (_showClose != value)
{
_showClose = value;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -