TableLayoutColumnStyleCollection クラス

定義

ColumnStyle オブジェクトを格納するコレクション。

public ref class TableLayoutColumnStyleCollection : System::Windows::Forms::TableLayoutStyleCollection
public class TableLayoutColumnStyleCollection : System.Windows.Forms.TableLayoutStyleCollection
type TableLayoutColumnStyleCollection = class
    inherit TableLayoutStyleCollection
Public Class TableLayoutColumnStyleCollection
Inherits TableLayoutStyleCollection
継承
TableLayoutColumnStyleCollection

次の例は、 に を設定 ColumnStyle する方法を TableLayoutColumnStyleCollection示しています。 このコード例は、 コントロールに対して提供されるより大きな例の TableLayoutPanel 一部です。

private void toggleColumnStylesBtn_Click(
    System.Object sender, 
    System.EventArgs e)
{
    TableLayoutColumnStyleCollection styles = 
        this.TableLayoutPanel1.ColumnStyles;

    foreach( ColumnStyle style in styles )
    {
        if( style.SizeType == SizeType.Absolute )
        {
            style.SizeType = SizeType.AutoSize;
        }
        else if( style.SizeType == SizeType.AutoSize )
        {
            style.SizeType = SizeType.Percent;

            // Set the column width to be a percentage
            // of the TableLayoutPanel control's width.
            style.Width = 33;
        }
        else
        {
            // Set the column width to 50 pixels.
            style.SizeType = SizeType.Absolute;
            style.Width = 50;
        }
    }
}
Private Sub toggleColumnStylesBtn_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles toggleColumnStylesBtn.Click

    Dim styles As TableLayoutColumnStyleCollection = _
    Me.TableLayoutPanel1.ColumnStyles

    For Each style As ColumnStyle In styles

        If style.SizeType = SizeType.Absolute Then

            style.SizeType = SizeType.AutoSize

        ElseIf style.SizeType = SizeType.AutoSize Then

            style.SizeType = SizeType.Percent

            ' Set the column width to be a percentage
            ' of the TableLayoutPanel control's width.
            style.Width = 33

        Else

            ' Set the column width to 50 pixels.
            style.SizeType = SizeType.Absolute
            style.Width = 50

        End If

    Next

End Sub

注釈

クラスは TableLayoutColumnStyleCollection 、関連付けられている TableLayoutPanel内の列を記述するために使用されるすべてのスタイルのコレクションを表します。

プロパティ

Count

TableLayoutStyleCollection に実際に格納されているスタイルの数を取得します。

(継承元 TableLayoutStyleCollection)
Item[Int32]

指定したインデックス位置にある ColumnStyle を取得または設定します。

メソッド

Add(ColumnStyle)

TableLayoutColumnStyleCollection に項目を追加します。

Add(TableLayoutStyle)

新しい TableLayoutStyle を現在のコレクションの末尾に追加します。

(継承元 TableLayoutStyleCollection)
Clear()

関連付けられた TableLayoutPanel からコレクションの関連付けを解除し、コレクションを空にします。

(継承元 TableLayoutStyleCollection)
Contains(ColumnStyle)

指定した ColumnStyle がコレクション内にあるかどうかを判別します。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IndexOf(ColumnStyle)

TableLayoutColumnStyleCollection 内の特定の項目のインデックスを確認します。

Insert(Int32, ColumnStyle)

ColumnStyle 内の指定した位置に TableLayoutColumnStyleCollection を挿入します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
Remove(ColumnStyle)

ColumnStyle 内で最初に見つかった特定の TableLayoutColumnStyleCollection を削除します。

RemoveAt(Int32)

コレクションの指定したインデックスにあるスタイルを削除します。

(継承元 TableLayoutStyleCollection)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

ICollection.CopyTo(Array, Int32)

このメソッドの説明については、CopyTo(Array, Int32) メソッドのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
ICollection.IsSynchronized

このメソッドの説明については、IsSynchronized プロパティのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
ICollection.SyncRoot

このメソッドの説明については、SyncRoot プロパティのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IEnumerable.GetEnumerator()

このメソッドの説明については、GetEnumerator() メソッドのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IList.Add(Object)

このメソッドの説明については、Add(Object) メソッドのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IList.Contains(Object)

このメソッドの説明については、Contains(Object) メソッドのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IList.IndexOf(Object)

このメソッドの説明については、IndexOf(Object) メソッドのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IList.Insert(Int32, Object)

このメソッドの説明については、Insert(Int32, Object) メソッドのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IList.IsFixedSize

このメソッドの説明については、IsFixedSize プロパティのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IList.IsReadOnly

このメソッドの説明については、IsReadOnly プロパティのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IList.Item[Int32]

このメソッドの説明については、Item[Int32] プロパティのトピックを参照してください。

(継承元 TableLayoutStyleCollection)
IList.Remove(Object)

このメソッドの説明については、Remove(Object) メソッドのトピックを参照してください。

(継承元 TableLayoutStyleCollection)

拡張メソッド

Cast<TResult>(IEnumerable)

IEnumerable の要素を、指定した型にキャストします。

OfType<TResult>(IEnumerable)

指定された型に基づいて IEnumerable の要素をフィルター処理します。

AsParallel(IEnumerable)

クエリの並列化を有効にします。

AsQueryable(IEnumerable)

IEnumerableIQueryable に変換します。

適用対象

こちらもご覧ください