DataGrid.PreferredRowHeight 속성

정의

DataGrid 컨트롤의 기본 행 높이를 가져오거나 설정합니다.

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

속성 값

Int32

행의 높이입니다.

예제

다음 코드 예제에서는 먼저 새 글꼴을 설정하고 새 글꼴과 동일한 높이로 설정합니다 PreferredRowHeight .

private:
   void ChangeFontHeight( DataGrid^ myGrid )
   {
      myGrid->Font = gcnew System::Drawing::Font(
         "Microsoft Sans Serif",
         15, System::Drawing::FontStyle::Regular );
      myGrid->PreferredRowHeight = myGrid->Font->Height;
   }
private void ChangeFontHeight(DataGrid myGrid)
{
   myGrid.Font = new System.Drawing.Font
      ("Microsoft Sans Serif",
      15, System.Drawing.FontStyle.Regular);
   myGrid.PreferredRowHeight = myGrid.Font.Height;
}
Private Sub ChangeFontHeight(ByVal myGrid As DataGrid)
   ' Change the font first.
   myGrid.Font = New System.Drawing.Font _
   ("Microsoft Sans Serif", 15, _
   System.Drawing.FontStyle.Regular)

   myGrid.PreferredRowHeight = myGrid.Font.Height
End Sub

설명

및 속성을 다시 설정 DataSource DataMember 하기 전에(개별적으로 또는 메서드를 SetDataBinding 통해) 이 속성을 설정하거나 속성이 적용되지 않습니다.

적용 대상

추가 정보