[]在DataGrid中添加图片列的代码何解
[求助]在DataGrid中添加图片列的代码何解
在网上找到一段代码,主要功能在DataGrid中添加图片列,但我不知代码的意思,不知那位兄弟姐妹帮忙解释一下,先谢谢了。
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Data
Imports System.Collections
Public Class DataGridImageCell
Inherits DataGridTextBoxColumn
Private theImages1 As ArrayList
Private _bRect As Boolean
Private _rowNumber As Integer = 0
Property RowNumber() As Integer
Get
Return _rowNumber
End Get
Set(ByVal Value As Integer)
_rowNumber = Value
End Set
End Property
Property bRect() As Boolean
Get
Return _bRect
End Get
Set(ByVal Value As Boolean)
_bRect = Value
End Set
End Property
Public Sub New()
bRect = False
End Sub
Public Property theImages() As ArrayList
Get
Return theImages1
End Get
Set(ByVal Value As ArrayList)
theImages1 = Value
End Set
End Property
Public Sub PaintRect()
Me.Invalidate()
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 backBrush As System.Drawing.Brush, ByVal foreBrush As System.Drawing.Brush, ByVal alignToRight As Boolean)
在网上找到一段代码,主要功能在DataGrid中添加图片列,但我不知代码的意思,不知那位兄弟姐妹帮忙解释一下,先谢谢了。
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Data
Imports System.Collections
Public Class DataGridImageCell
Inherits DataGridTextBoxColumn
Private theImages1 As ArrayList
Private _bRect As Boolean
Private _rowNumber As Integer = 0
Property RowNumber() As Integer
Get
Return _rowNumber
End Get
Set(ByVal Value As Integer)
_rowNumber = Value
End Set
End Property
Property bRect() As Boolean
Get
Return _bRect
End Get
Set(ByVal Value As Boolean)
_bRect = Value
End Set
End Property
Public Sub New()
bRect = False
End Sub
Public Property theImages() As ArrayList
Get
Return theImages1
End Get
Set(ByVal Value As ArrayList)
theImages1 = Value
End Set
End Property
Public Sub PaintRect()
Me.Invalidate()
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 backBrush As System.Drawing.Brush, ByVal foreBrush As System.Drawing.Brush, ByVal alignToRight As Boolean)