Share via


DataGridViewRowHeightInfoNeededEventArgs.MinimumHeight Properti

Definisi

Mendapatkan atau mengatur tinggi minimum baris tempat peristiwa terjadi.

public:
 property int MinimumHeight { int get(); void set(int value); };
public int MinimumHeight { get; set; }
member this.MinimumHeight : int with get, set
Public Property MinimumHeight As Integer

Nilai Properti

Tinggi baris minimum.

Pengecualian

Nilai yang ditentukan saat mengatur properti ini kurang dari 2.

Contoh

Contoh kode berikut menunjukkan penggunaan anggota ini. Dalam contoh, penanganan aktivitas melaporkan terjadinya DataGridView.RowHeightInfoNeeded peristiwa. Laporan ini membantu Anda mempelajari kapan peristiwa terjadi dan dapat membantu Anda dalam penelusuran kesalahan. Untuk melaporkan beberapa peristiwa atau pada peristiwa yang sering terjadi, pertimbangkan untuk mengganti MessageBox.Show dengan Console.WriteLine atau menambahkan pesan ke multibaris TextBox.

Untuk menjalankan kode contoh, tempelkan ke dalam proyek yang berisi instans jenis DataGridView bernama DataGridView1. Kemudian pastikan bahwa penanganan aktivitas dikaitkan dengan DataGridView.RowHeightInfoNeeded peristiwa.

private void DataGridView1_RowHeightInfoNeeded(Object sender, DataGridViewRowHeightInfoNeededEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Height", e.Height );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "MinimumHeight", e.MinimumHeight );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RowHeightInfoNeeded Event" );
}
Private Sub DataGridView1_RowHeightInfoNeeded(sender as Object, e as DataGridViewRowHeightInfoNeededEventArgs) _ 
     Handles DataGridView1.RowHeightInfoNeeded

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Height", e.Height)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "MinimumHeight", e.MinimumHeight)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "RowIndex", e.RowIndex)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"RowHeightInfoNeeded Event")

End Sub

Berlaku untuk

Lihat juga