DrawCell 代码:
If e.Col.Name = "邮寄状态" Then
e.StartDraw()
Dim w As Integer = e.Width - 4
Dim h As Integer = e.Height - 4
Dim x As Integer = e.x + (e.Width - w)/2
Dim n As Pen
Dim fnt As New Font("黑体",9)
Dim br As object
Dim msg As String
If e.Row("邮寄") = True Then
n = New Pen(Color.Blue,2)
br = New SolidBrush(color.Blue)
msg = "已邮寄"
Else
n = New Pen(Color.Red,2)
br = New SolidBrush(color.red)
msg = "未邮寄"
End If
e.Graphics.DrawRectangle(n,x,e.y + 2,w,h)
e.Graphics.DrawString(msg,fnt,br,x + 10,e.y + 15)
e.Text = ""
e.EndDraw()
End If
此主题相关图片如下:image 2.png