datagridcolumnstyle重写,实现插入不同控件列体验(二)

2014-11-23 20:25:23 · 作者: · 浏览: 25
tion

Protected Overrides Function GetPreferredSize(ByVal g As System.Drawing.Graphics, ByVal value As Object) As System.Drawing.Size
Return New Size(50, m_TextBox.PreferredHeight + 2)
End Function

#End Region

#Region "Paint"

Protected Overloads Overrides Sub Paint(ByVal g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal [source] As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer)
Paint(g, bounds, [source], rowNum, False)
End Sub

Protected Overloads Overrides Sub Paint(ByVal g As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal [source] As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal alignToRight As Boolean)
Dim brush_for As Brush = New SolidBrush(Me.DataGridTableStyle.ForeColor)
Dim brush_bak As Brush = New SolidBrush(Me.D