TabStripPageCollection Class
Encapsulates a collection of TabStripPage components.
public class TabStripPageCollection : IList, ICollection, IEnumerable
- Inheritance:
- Object Object
Remarks
This class is a zero-based indexed collection.
Constructors
TabStripPageCollection(Control.ControlCollection)
Initializes a new instance of the TabStripPageCollection
class.
public TabStripPageCollection(Control.ControlCollection tabStripControls)
Parameter | Type | Description |
---|---|---|
tabStripControls | Control.ControlCollection | The control collection to link to. |
Properties
Count
Gets the number of pages contained in the collection.
public virtual int Count { get; }
Property Value
- Int32:
The number of pages contained in the collection.
IsFixedSize
Gets a value indicating whether the collection has a fixed size.
public bool IsFixedSize { get; }
Property Value
- Boolean:
true
if the collection has a fixed size; otherwise,false
.
Remarks
A collection with a fixed size does not allow the addition or removal of elements, but it allows the modification of existing elements.
IsReadOnly
Gets a value indicating whether the collection is read-only.
public bool IsReadOnly { get; }
Property Value
- Boolean:
true
if the collection is read-only; otherwise,false
.
IsSynchronized
Gets a value indicating whether access to the collection is synchronized (thread-safe).
public virtual bool IsSynchronized { get; }
Property Value
- Boolean:
true
if the collection is synchronized (thread-safe); otherwise,false
.
Remarks
To guarantee the thread safety of the collection, all operations must be done through the wrapper returned by the SyncRoot property.
Item[Int32]
Gets the TabStripPage at the specified index.
[C#] In C#, this property is the indexer for the TabStripPageCollection
class.
public TabStripPage this[int index] { get; set; }
Parameter | Type | Description |
---|---|---|
index | Int32 | The index of the TabStripPage to return. |
Property Value
- TabStripPage:
The TabStripPage at the specified index.
Item[String]
Gets the TabStripPage with the specified key.
public TabStripPage this[string key] { get; }
Parameter | Type | Description |
---|---|---|
key | String | The key of the TabStripPage to return. |
Property Value
- TabStripPage:
The TabStripPage with the specified key.
SyncRoot
Gets an Object
that can be used to synchronize access to the collection.
public virtual object SyncRoot { get; }
Property Value
- Object:
An
Object
that can be used to synchronize access to the collection.
Methods
Add(TabStripPage)
Adds the specified TabStripPage to the collection.
public int Add(TabStripPage page)
Parameter | Type | Description |
---|---|---|
page | TabStripPage | The TabStripPage to add. |
Returns
- Int32:
The index of the TabStripPage that was inserted.
AddRange(TabStripPage[])
Adds the specified array of TabStripPage controls to the collection.
public void AddRange(TabStripPage[] pages)
Parameter | Type | Description |
---|---|---|
pages | TabStripPage[] | The array of TabStripPage controls to add. |
Clear()
Removes all TabStripPage objects from the collection.
public void Clear()
Contains(TabStripPage)
Determines whether the specified TabStripPage is in the collection.
public bool Contains(TabStripPage page)
Parameter | Type | Description |
---|---|---|
page | TabStripPage | The TabStripPage to look for. |
Returns
- Boolean:
true
if the collection contains the TabStripPage; otherwise,false
.
Contains(String)
Determines whether the a TabStripPage with the specified key is in the collection.
public virtual bool Contains(string key)
Parameter | Type | Description |
---|---|---|
key | String | The key of the TabStripPage to look for. |
Returns
- Boolean:
true
if the collection contains a TabStripPage with the specified key; otherwise,false
.
CopyTo(Array, Int32)
Copies the entire collection to a compatible one-dimensional Array
,
starting at the specified index of the target array.
public virtual void CopyTo(Array array, int arrayIndex)
Parameter | Type | Description |
---|---|---|
array | Array | The one-dimensional |
arrayIndex | Int32 | The zero-based index in |
GetEnumerator()
Retrieves an IEnumerator
object for the entire collection.
public virtual IEnumerator GetEnumerator()
Returns
- IEnumerator:
An
IEnumerator
object for the entire collection
Remarks
Enumerators are intended to be used only to read data in the collection. Enumerators cannot be used to modify the underlying collection.
The enumerator does not have exclusive access to the collection.
When an enumerator is instantiated, it takes a snapshot of the current state of the collection.
If changes are made to the collection, such as adding, modifying or deleting elements, the
snapshot gets out of sync and the enumerator throws an InvalidOperationException
.
Two enumerators instantiated from the same collection at the same time can have
different snapshots of the collection.
IndexOf(TabStripPage)
Returns the index of the specified TabStripPage in the collection.
public int IndexOf(TabStripPage page)
Parameter | Type | Description |
---|---|---|
page | TabStripPage | The TabStripPage to look for. |
Returns
- Int32:
If found, the index where the TabStripPage is in the collection; otherwise,
-1
.
IndexOf(String)
Returns the index of the TabStripPage with the specified key in the collection.
public int IndexOf(string key)
Parameter | Type | Description |
---|---|---|
key | String | The key of the TabStripPage to look for. |
Returns
- Int32:
If found, the index where the TabStripPage is in the collection; otherwise,
-1
.
Insert(Int32, TabStripPage)
Inserts an TabStripPage into the specified location in the collection.
public void Insert(int index, TabStripPage page)
Parameter | Type | Description |
---|---|---|
index | Int32 | The index at which to place the TabStripPage. |
page | TabStripPage | The TabStripPage to add. |
MoveTo(TabStripPage, Int32)
Moves a TabStripPage to the specified index.
public void MoveTo(TabStripPage page, int newIndex)
Parameter | Type | Description |
---|---|---|
page | TabStripPage | The TabStripPage to move. |
newIndex | Int32 | The new index. |
Remove(TabStripPage)
Removes the specified TabStripPage from the collection.
public void Remove(TabStripPage page)
Parameter | Type | Description |
---|---|---|
page | TabStripPage | The TabStripPage to remove. |
RemoveAt(Int32)
Removes the TabStripPage at the specified index from the collection.
public void RemoveAt(int index)
Parameter | Type | Description |
---|---|---|
index | Int32 | The index of the TabStripPage to remove. |
Inherited Members
- Object.ToString()
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()