本文整理汇总了VB.NET中System.Windows.Forms.DataGridTextBoxColumn.GetPreferredHeight方法的典型用法代码示例。如果您正苦于以下问题:VB.NET DataGridTextBoxColumn.GetPreferredHeight方法的具体用法?VB.NET DataGridTextBoxColumn.GetPreferredHeight怎么用?VB.NET DataGridTextBoxColumn.GetPreferredHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataGridTextBoxColumn
的用法示例。
在下文中一共展示了DataGridTextBoxColumn.GetPreferredHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Form1
Public Class Form1
Inherits Form
Protected dataGrid1 As DataGrid
Private Sub GetPreferredHeight()
Dim g As Graphics
g = Me.CreateGraphics()
Dim gridPreferredHeight As Integer
Dim myTextColumn As MyGridColumn
' Assuming column 1 of a DataGrid control is a
' DataGridTextBoxColumn.
myTextColumn = CType(dataGrid1.TableStyles(0). _
GridColumnStyles(1), MyGridColumn)
Dim myVal As String
myVal = "A long string value"
gridPreferredHeight = myTextColumn.GetPrefHeight _
(g, myVal)
Console.WriteLine(gridPreferredHeight)
End Sub
End Class
Public Class MyGridColumn
Inherits DataGridTextBoxColumn
public Function GetPrefHeight(g As Graphics , val As string) _
As Integer
return me.GetPreferredHeight(g, val)
End Function
End Class