TableLayoutRowStyleCollection クラス

定義

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

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

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

private void toggleRowStylesBtn_Click(
    System.Object sender, 
    System.EventArgs e)
{
    TableLayoutRowStyleCollection styles = 
        this.TableLayoutPanel1.RowStyles;

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

            // Set the row height to be a percentage
            // of the TableLayoutPanel control's height.
            style.Height = 33;
        }
        else
        {

            // Set the row height to 50 pixels.
            style.SizeType = SizeType.Absolute;
            style.Height = 50;
        }
    }
}
Private Sub toggleRowStylesBtn_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles toggleRowStylesBtn.Click

    Dim styles As TableLayoutRowStyleCollection = _
    Me.TableLayoutPanel1.RowStyles

    For Each style As RowStyle In styles

        If style.SizeType = SizeType.Absolute Then

            style.SizeType = SizeType.AutoSize

        ElseIf style.SizeType = SizeType.AutoSize Then

            style.SizeType = SizeType.Percent

            ' Set the row height to be a percentage
            ' of the TableLayoutPanel control's height.
            style.Height = 33

        Else

            ' Set the row height to 50 pixels.
            style.SizeType = SizeType.Absolute
            style.Height = 50

        End If

    Next

End Sub

注釈

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

プロパティ

名前 説明
Count

TableLayoutStyleCollectionに実際に含まれるスタイルの数を取得します。

(継承元 TableLayoutStyleCollection)
Item[Int32]

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

メソッド

名前 説明
Add(RowStyle)

RowStyleに新しいTableLayoutRowStyleCollectionを追加します。

Add(TableLayoutStyle)

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

(継承元 TableLayoutStyleCollection)
Clear()

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

(継承元 TableLayoutStyleCollection)
Contains(RowStyle)

TableLayoutRowStyleCollectionに特定のスタイルが含まれているかどうかを判断します。

Equals(Object)

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

(継承元 Object)
GetHashCode()

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

(継承元 Object)
GetType()

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

(継承元 Object)
IndexOf(RowStyle)

TableLayoutRowStyleCollection内の特定の項目のインデックスを決定します。

Insert(Int32, RowStyle)

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

MemberwiseClone()

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

(継承元 Object)
Remove(RowStyle)

特定のオブジェクトの最初の出現箇所を TableLayoutRowStyleCollectionから削除します。

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 の要素をフィルター処理します。

適用対象

こちらもご覧ください