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

次の例は、TableLayoutColumnStyleCollectionColumnStyleを設定する方法を示しています。 このコード例は、 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)

指定した位置にあるTableLayoutColumnStyleCollectionColumnStyleを挿入します。

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)

拡張メソッド

名前 説明
AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerableIQueryableに変換します。

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

適用対象

こちらもご覧ください