using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
+using System.Runtime.InteropServices;
namespace System.Windows.Forms {
+ [ComVisible (true)]
+ [ClassInterface (ClassInterfaceType.AutoDispatch)]
[DefaultEvent("Click")]
[DesignTimeVisible(false)]
[DefaultProperty("Text")]
[ToolboxItem(false)]
public class TabPage : Panel {
#region Fields
- private int image_index = -1;
+ private int imageIndex = -1;
+ private string imageKey;
private string tooltip_text = String.Empty;
private Rectangle tab_bounds;
private int row;
#endregion // Public Constructors
#region .NET 2.0 Public Instance Properties
-#if NET_2_0
+ [Browsable (false)]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+ public override bool AutoSize {
+ get { return base.AutoSize; }
+ set { base.AutoSize = value; }
+ }
+
+ [Browsable (false)]
+ [Localizable (false)]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+ public override AutoSizeMode AutoSizeMode {
+ get { return base.AutoSizeMode; }
+ set { base.AutoSizeMode = value; }
+ }
+
+ [Browsable (false)]
+ [DefaultValue ("{Width=0, Height=0}")]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ public override Size MaximumSize {
+ get { return base.MaximumSize; }
+ set { base.MaximumSize = value; }
+ }
+
+ [Browsable (false)]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ public override Size MinimumSize {
+ get { return base.MinimumSize; }
+ set { base.MinimumSize = value; }
+ }
+
+ [Browsable (false)]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ public new Size PreferredSize {
+ get { return base.PreferredSize; }
+ }
+
+ [DefaultValue (false)]
public bool UseVisualStyleBackColor {
get { return use_visual_style_back_color; }
set { use_visual_style_back_color = value; }
get { return base.BackColor; }
set { use_visual_style_back_color = false; base.BackColor = value; }
}
-#endif
#endregion
#region Public Instance Properties
set { base.Enabled = value; }
}
+ [RefreshProperties (RefreshProperties.Repaint)]
[DefaultValue(-1)]
[Editor("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))]
[Localizable(true)]
[TypeConverter(typeof(ImageIndexConverter))]
public int ImageIndex {
- get { return image_index; }
+ get { return imageIndex; }
set {
- if (image_index == value)
+ if (imageIndex == value)
return;
- image_index = value;
+ imageIndex = value;
UpdateOwner ();
}
}
+ [Localizable (true)]
+ [RefreshProperties (RefreshProperties.Repaint)]
+ [DefaultValue ("")]
+ [Editor ("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design,
+ "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
+ [TypeConverter (typeof (ImageKeyConverter))]
+ public string ImageKey
+ {
+ get { return imageKey; }
+ set {
+ imageKey = value;
+ TabControl control = this.Parent as TabControl;
+ if (control != null) {
+ ImageIndex = control.ImageList.Images.IndexOfKey (imageKey);
+ }
+ }
+ }
+
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public new int TabIndex {
set { base.TabStop = value; }
}
+ [EditorBrowsable (EditorBrowsableState.Always)]
[Browsable(true)]
[Localizable(true)]
public override string Text {
}
}
+ protected override void OnEnter (EventArgs e)
+ {
+ base.OnEnter (e);
+ }
+
+ protected override void OnLeave (EventArgs e)
+ {
+ base.OnLeave (e);
+ }
+
+ protected override void OnPaintBackground (PaintEventArgs e)
+ {
+ base.OnPaintBackground (e);
+ }
#endregion // Protected Instance Methods
#region Events
+ [Browsable (false)]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ public new event EventHandler AutoSizeChanged {
+ add { base.AutoSizeChanged += value; }
+ remove { base.AutoSizeChanged -= value; }
+ }
+
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public new event EventHandler DockChanged {
remove { base.EnabledChanged -= value; }
}
+ [Browsable (false)]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ public new event EventHandler LocationChanged {
+ add { base.LocationChanged += value; }
+ remove { base.LocationChanged -= value; }
+ }
+
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public new event EventHandler TabIndexChanged {
remove { base.TabStopChanged -= value; }
}
+ [Browsable (true)]
+ [EditorBrowsable (EditorBrowsableState.Always)]
+ public new event EventHandler TextChanged {
+ add { base.TextChanged += value; }
+ remove { base.TextChanged -= value; }
+ }
+
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public new event EventHandler VisibleChanged {
#endregion // Events
-#if NET_2_0
+ [Browsable (false)]
+ [EditorBrowsable (EditorBrowsableState.Never)]
public new Point Location {
get {
return base.Location;
base.Location = value;
}
}
-#endif
+
#region Class TabPageControlCollection
+ [ComVisible (false)]
public class TabPageControlCollection : ControlCollection {
- private TabPage owner;
+ //private TabPage owner;
public TabPageControlCollection (TabPage owner) : base (owner)
{
- this.owner = owner;
+ //this.owner = owner;
}
public override void Add (Control value)