This documentation is archived and is not being maintained.

TabControl.TabPageCollection.IsReadOnly Property

Gets a value indicating whether the collection is read-only.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public bool IsReadOnly { get; }

Property Value

Type: System.Boolean
This property always returns false.



The following code example creates a TabControl with two TabPage. This example gets the tabControl1 controls collection and determines if it is read-only using the IsReadOnly property.

Use the System.Drawing and System.Windows.Forms namespaces for this example.

using System.Drawing;
using System.Windows.Forms;

public class Form1 : Form
    public Form1()
        TabControl tabControl1 = new TabControl();
        TabPage tabPage1 = new TabPage();
        TabPage tabPage2 = new TabPage();
        Label label1 = new Label();

        // Determines if the tabControl1 controls collection is read-only.
        if (tabControl1.TabPages.IsReadOnly == true)
	        label1.Text = "The tabControl1 controls collection is read-only.";
	        label1.Text = "The tabControl1 controls collection is not read-only.";

        tabControl1.TabPages.AddRange(new TabPage[] {tabPage1, tabPage2});
        tabControl1.Location = new Point(25, 75);
        tabControl1.Size = new Size(250, 200);

        label1.Location = new Point(25, 25);
        label1.Size = new Size(250, 25);

        this.ClientSize = new Size(300, 300);
        this.Controls.AddRange(new Control[] {tabControl1, label1});

    static void Main() 
        Application.Run(new Form1());

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.