แก้ไข

แชร์ผ่าน


DataGridViewRow.MinimumHeight Property

Definition

Gets or sets the minimum height of the row.

public:
 property int MinimumHeight { int get(); void set(int value); };
[System.ComponentModel.Browsable(false)]
public int MinimumHeight { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.MinimumHeight : int with get, set
Public Property MinimumHeight As Integer

Property Value

The minimum row height in pixels, ranging from 2 to Int32.MaxValue. The default is 3.

Attributes

Exceptions

When setting this property, the row is in a DataGridView control and is a shared row.

The specified value when setting this property is less than 2.

Examples

The following code example uses the MinimumHeight property to set the minimum height of the second row. This code example is part of a larger code example provided in How to: Manipulate Rows in the Windows Forms DataGridView Control.

// Set minimum height.
void Button4_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   int secondRow = 1;
   DataGridViewRow^ row = dataGridView->Rows[ secondRow ];
   row->MinimumHeight = 40;
}
// Set minimum height.
private void Button4_Click(object sender, System.EventArgs e)
{

    int secondRow = 1;
    DataGridViewRow row = dataGridView.Rows[secondRow];
    row.MinimumHeight = 40;
}
' Set minimum height.
Private Sub Button4_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Button4.Click

    Dim secondRow As Integer = 1
    Dim row As DataGridViewRow = dataGridView.Rows(secondRow)
    row.MinimumHeight = 40
End Sub

Remarks

The MinimumHeight property maintains the display of the row by setting a limit to how far the user can resize the row's height through the user interface (UI).

Applies to

See also