本文整理汇总了VB.NET中System.Windows.Forms.DataGridViewRow.GetPreferredHeight方法的典型用法代码示例。如果您正苦于以下问题:VB.NET DataGridViewRow.GetPreferredHeight方法的具体用法?VB.NET DataGridViewRow.GetPreferredHeight怎么用?VB.NET DataGridViewRow.GetPreferredHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataGridViewRow
的用法示例。
在下文中一共展示了DataGridViewRow.GetPreferredHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: dataGridView1_RowHeightChanged
' Adjusts the padding when the user changes the row height so that
' the normal cell content is fully displayed and any extra
' height is used for the content that spans multiple columns.
Sub dataGridView1_RowHeightChanged(ByVal sender As Object, _
ByVal e As DataGridViewRowEventArgs) _
Handles dataGridView1.RowHeightChanged
' Calculate the new height of the normal cell content.
Dim preferredNormalContentHeight As Int32 = _
e.Row.GetPreferredHeight(e.Row.Index, _
DataGridViewAutoSizeRowMode.AllCellsExceptHeader, True) - _
e.Row.DefaultCellStyle.Padding.Bottom()
' Specify a new padding.
Dim newPadding As Padding = e.Row.DefaultCellStyle.Padding
newPadding.Bottom = e.Row.Height - preferredNormalContentHeight
e.Row.DefaultCellStyle.Padding = newPadding
End Sub