Bahasa

TableLayoutRowStyleCollection Kelas

Definisi

Koleksi yang menyimpan RowStyle objek.

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
Warisan
TableLayoutRowStyleCollection

Contoh

Contoh berikut menunjukkan cara mengatur RowStyle untuk TableLayoutRowStyleCollection. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk TableLayoutPanel kontrol.

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

Keterangan

Kelas TableLayoutRowStyleCollection mewakili koleksi semua gaya yang digunakan untuk menjelaskan baris dalam yang terkait TableLayoutPanel.

Properti

Nama Deskripsi
Count

Mendapatkan jumlah gaya yang sebenarnya terkandung dalam TableLayoutStyleCollection.

(Diperoleh dari TableLayoutStyleCollection)
Item[Int32]

Mendapatkan atau mengatur pada RowStyle indeks yang ditentukan.

Metode

Nama Deskripsi
Add(RowStyle)

Menambahkan baru RowStyle ke TableLayoutRowStyleCollection.

Add(TableLayoutStyle)

Menambahkan baru TableLayoutStyle ke akhir koleksi saat ini.

(Diperoleh dari TableLayoutStyleCollection)
Clear()

Memisahkan koleksi dari koleksi terkait TableLayoutPanel dan mengikat koleksi.

(Diperoleh dari TableLayoutStyleCollection)
Contains(RowStyle)

Menentukan apakah TableLayoutRowStyleCollection berisi gaya tertentu.

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
IndexOf(RowStyle)

Menentukan indeks item tertentu di TableLayoutRowStyleCollection.

Insert(Int32, RowStyle)

RowStyle Menyisipkan ke TableLayoutRowStyleCollection dalam pada posisi yang ditentukan.

MemberwiseClone()

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
Remove(RowStyle)

Menghapus kemunculan pertama objek tertentu dari TableLayoutRowStyleCollection.

RemoveAt(Int32)

Menghapus gaya pada indeks koleksi yang ditentukan.

(Diperoleh dari TableLayoutStyleCollection)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

Nama Deskripsi
ICollection.CopyTo(Array, Int32)

Untuk deskripsi metode ini, lihat CopyTo(Array, Int32) metode .

(Diperoleh dari TableLayoutStyleCollection)
ICollection.IsSynchronized

Untuk deskripsi metode ini, lihat IsSynchronized properti .

(Diperoleh dari TableLayoutStyleCollection)
ICollection.SyncRoot

Untuk deskripsi metode ini, lihat SyncRoot properti .

(Diperoleh dari TableLayoutStyleCollection)
IEnumerable.GetEnumerator()

Untuk deskripsi metode ini, lihat GetEnumerator() metode .

(Diperoleh dari TableLayoutStyleCollection)
IList.Add(Object)

Untuk deskripsi metode ini, lihat Add(Object) metode .

(Diperoleh dari TableLayoutStyleCollection)
IList.Contains(Object)

Untuk deskripsi metode ini, lihat Contains(Object) metode .

(Diperoleh dari TableLayoutStyleCollection)
IList.IndexOf(Object)

Untuk deskripsi metode ini, lihat IndexOf(Object) metode .

(Diperoleh dari TableLayoutStyleCollection)
IList.Insert(Int32, Object)

Untuk deskripsi metode ini, lihat Insert(Int32, Object) metode .

(Diperoleh dari TableLayoutStyleCollection)
IList.IsFixedSize

Untuk deskripsi metode ini, lihat IsFixedSize properti .

(Diperoleh dari TableLayoutStyleCollection)
IList.IsReadOnly

Untuk deskripsi metode ini, lihat IsReadOnly properti .

(Diperoleh dari TableLayoutStyleCollection)
IList.Item[Int32]

Untuk deskripsi metode ini, lihat Item[Int32] properti .

(Diperoleh dari TableLayoutStyleCollection)
IList.Remove(Object)

Untuk deskripsi metode ini, lihat Remove(Object) metode .

(Diperoleh dari TableLayoutStyleCollection)

Metode Ekstensi

Nama Deskripsi
AsParallel(IEnumerable)

Mengaktifkan paralelisasi kueri.

AsQueryable(IEnumerable)

Mengonversi IEnumerable menjadi IQueryable.

Cast<TResult>(IEnumerable)

Melemparkan elemen IEnumerable ke jenis yang ditentukan.

OfType<TResult>(IEnumerable)

Memfilter elemen IEnumerable berdasarkan jenis tertentu.

Berlaku untuk

Lihat juga