In This Article

TabStripPage Class

Represents a page for a TabStrip control.

public class TabStripPage : UIContainerControl, IUIControl, IUIElement, ILogicalTreeNode, IDpiAwareElement, IDisposable, IImageListProvider
Inheritance:
object MarshalByRefObject Component Control ScrollableControl ContainerControl UIContainerControl object
Implements:
IUIControl IUIElement ILogicalTreeNode IDpiAwareElement IDisposable IImageListProvider

Constructors

TabStripPage()

Initializes an instance of the class.

public TabStripPage()

TabStripPage(string?, string, Image?)

Initializes an instance of the class.

public TabStripPage(string? key, string text, Image? image)
Parameter Type Description
key string

A string-based key that identifies an object within its parent collection.

text string

The text caption.

image Image

The image.

TabStripPage(string?, string, int)

Initializes an instance of the class.

public TabStripPage(string? key, string text, int imageIndex = -1)
Parameter Type Description
key string

A string-based key that identifies an object within its parent collection.

text string

The text caption.

imageIndex int

The index of an image within an ImageList.

Properties

Active

Indicates whether the page is visible.

public bool Active { get; set; }

Property Value

bool:

true if the page is visible; otherwise, false.

Anchor

Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent.

[Browsable(false)]
public override AnchorStyles Anchor { get; set; }

Property Value

AnchorStyles:

A bitwise combination of the AnchorStyles values. The default is Top and Left.

BackgroundFill

The page-specific BackgroundFill for the page.

public BackgroundFill? BackgroundFill { get; set; }

Property Value

BackgroundFill

ContextImage

The context image that is displayed for the page on the opposite side of the tab.

public Image? ContextImage { get; set; }

Property Value

Image:

The default value is null.

Dock

Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent.

[Browsable(false)]
public override DockStyle Dock { get; set; }

Property Value

DockStyle:

One of the DockStyle values. The default is None.

Exceptions

Type Condition
InvalidEnumArgumentException

The value assigned is not one of the DockStyle values.

Enabled

Gets or sets a value indicating whether the control can respond to user interaction.

public bool Enabled { get; set; }

Property Value

bool:

true if the control can respond to user interaction; otherwise, false. The default is true.

Image

The image that is displayed on the page.

public Image? Image { get; set; }

Property Value

Image:

The default value is null.

ImageIndex

The index of an image within an ImageList that is displayed on the page.

[ImageIndex]
[TypeConverter(typeof(ImageIndexConverter))]
public int ImageIndex { get; set; }

Property Value

int:

The default value is -1.

IsSelected

Indicates whether the page is selected.

[Browsable(false)]
public bool IsSelected { get; }

Property Value

bool:

true if the page is selected; otherwise, false.

Key

A string-based key that identifies an object within its parent collection.

public string? Key { get; set; }

Property Value

string

TabDisabledForeColor

The page-specific foreground color of the page's tab when it is disabled.

public Color TabDisabledForeColor { get; set; }

Property Value

Color

TabIndex

Gets or sets the tab order of the control within its container.

[Browsable(false)]
public int TabIndex { get; set; }

Property Value

int:

The index value of the control within the set of controls within its container. The controls in the container are included in the tab order.

TabSelectedBackgroundFill

The page-specific BackgroundFill for the page's tab when it is selected.

public BackgroundFill? TabSelectedBackgroundFill { get; set; }

Property Value

BackgroundFill

TabSelectedFont

The page-specific Font to use for drawing the page's tab when it is selected.

public virtual Font? TabSelectedFont { get; set; }

Property Value

Font

TabSelectedForeColor

The page-specific foreground color of the page's tab when it is selected.

public Color TabSelectedForeColor { get; set; }

Property Value

Color

TabStop

Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.

[Browsable(false)]
public bool TabStop { get; set; }

Property Value

bool:
    <code>true</code> if the user can give the focus to the control using the TAB key; otherwise, <code>false</code>. The default is <code>true</code>.

Note: This property will always return true for an instance of the Form class.

TabStrip

The TabStrip that contains the page.

[Browsable(false)]
public TabStrip? TabStrip { get; }

Property Value

TabStrip

TabUnselectedBackgroundFill

The page-specific BackgroundFill for the page's tab when it is unselected.

public BackgroundFill? TabUnselectedBackgroundFill { get; set; }

Property Value

BackgroundFill

TabUnselectedFont

The page-specific Font to use for drawing the page's tab when it is unselected.

public virtual Font? TabUnselectedFont { get; set; }

Property Value

Font

TabUnselectedForeColor

The page-specific foreground color of the page's tab when it is unselected.

public Color TabUnselectedForeColor { get; set; }

Property Value

Color

Text

Gets or sets the text associated with this control.

public override string Text { get; set; }

Property Value

string:

The text associated with this control.

ToolTipText

The tool tip text for the page.

public string? ToolTipText { get; set; }

Property Value

string

UseControlGraphicsForMeasure

Indicates whether to use a call to the control's CreateGraphics method to obtain the Graphics used for measure routines.

protected override bool UseControlGraphicsForMeasure { get; }

Property Value

bool:

true if the control's CreateGraphics method should be called; otherwise, false. The default value is true.

UseExtendedDoubleBuffering

Indicates whether to use extended double buffering for rendering.

protected override bool UseExtendedDoubleBuffering { get; }

Property Value

bool:

true if extended double buffering should be used; otherwise, false.

Visible

Gets or sets a value indicating whether the control and all its child controls are displayed.

[Browsable(false)]
public bool Visible { get; set; }

Property Value

bool:

true to display the control and its child controls; otherwise, false. The default is true. When getting the value, true is returned only if the control is visible and the parent control, if it exists, is visible.

Methods

CreateControlsInstance()

Creates a new instance of the control collection for the control.

protected override Control.ControlCollection CreateControlsInstance()

Returns

Control.ControlCollection:

A new instance of Control.ControlCollection assigned to the control.

EnsureTabVisible()

Ensures that the tab for the page is visible.

public void EnsureTabVisible()

GetImage()

Returns the Image associated with the page.

public Image? GetImage()

Returns

Image

Remarks

If an image has been set to the Image property, that will be returned. Otherwise, the ImageIndex property will be used to find an image in a parent ImageList.

OnRender(PaintEventArgs)

Renders the element.

protected override void OnRender(PaintEventArgs e)
Parameter Type Description
e PaintEventArgs

The event data.

ResetBackgroundFill()

Resets the BackgroundFill property to its default value.

public virtual void ResetBackgroundFill()

ResetTabDisabledForeColor()

Resets the TabDisabledForeColor property to its default value.

public virtual void ResetTabDisabledForeColor()

ResetTabSelectedBackgroundFill()

Resets the TabSelectedBackgroundFill property to its default value.

public virtual void ResetTabSelectedBackgroundFill()

ResetTabSelectedFont()

Resets the TabSelectedFont property to its default value.

public virtual void ResetTabSelectedFont()

ResetTabSelectedForeColor()

Resets the TabSelectedForeColor property to its default value.

public virtual void ResetTabSelectedForeColor()

ResetTabUnselectedBackgroundFill()

Resets the TabUnselectedBackgroundFill property to its default value.

public virtual void ResetTabUnselectedBackgroundFill()

ResetTabUnselectedFont()

Resets the TabUnselectedFont property to its default value.

public virtual void ResetTabUnselectedFont()

ResetTabUnselectedForeColor()

Resets the TabUnselectedForeColor property to its default value.

public virtual void ResetTabUnselectedForeColor()

ShouldSerializeBackgroundFill()

Indicates whether the BackgroundFill property should be persisted.

public virtual bool ShouldSerializeBackgroundFill()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeTabDisabledForeColor()

Indicates whether the TabDisabledForeColor property should be persisted.

public virtual bool ShouldSerializeTabDisabledForeColor()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeTabSelectedBackgroundFill()

Indicates whether the TabSelectedBackgroundFill property should be persisted.

public virtual bool ShouldSerializeTabSelectedBackgroundFill()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeTabSelectedFont()

Indicates whether the TabSelectedFont property should be persisted.

public virtual bool ShouldSerializeTabSelectedFont()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeTabSelectedForeColor()

Indicates whether the TabSelectedForeColor property should be persisted.

public virtual bool ShouldSerializeTabSelectedForeColor()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeTabUnselectedBackgroundFill()

Indicates whether the TabUnselectedBackgroundFill property should be persisted.

public virtual bool ShouldSerializeTabUnselectedBackgroundFill()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeTabUnselectedFont()

Indicates whether the TabUnselectedFont property should be persisted.

public virtual bool ShouldSerializeTabUnselectedFont()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeTabUnselectedForeColor()

Indicates whether the TabUnselectedForeColor property should be persisted.

public virtual bool ShouldSerializeTabUnselectedForeColor()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

Inherited Members

Extension Methods