DataGridViewTopLeftHeaderCell.GetPreferredSize Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Calculates the preferred size, in pixels, of the cell.
protected:
override System::Drawing::Size GetPreferredSize(System::Drawing::Graphics ^ graphics, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, int rowIndex, System::Drawing::Size constraintSize);
protected override System.Drawing.Size GetPreferredSize (System.Drawing.Graphics graphics, System.Windows.Forms.DataGridViewCellStyle cellStyle, int rowIndex, System.Drawing.Size constraintSize);
override this.GetPreferredSize : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int * System.Drawing.Size -> System.Drawing.Size
Protected Overrides Function GetPreferredSize (graphics As Graphics, cellStyle As DataGridViewCellStyle, rowIndex As Integer, constraintSize As Size) As Size
Parameters
- cellStyle
- DataGridViewCellStyle
A DataGridViewCellStyle that represents the style of the cell.
- rowIndex
- Int32
The zero-based row index of the cell.
- constraintSize
- Size
The cell's maximum allowable size.
Returns
A Size that represents the preferred size, in pixels, of the cell.
Exceptions
rowIndex
does not equal -1.
Remarks
This method relies on the DataGridViewCell.GetFormattedValue method.
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET