If e.Col.Name = "图例" Then
Dim g As Graphics = e.Graphics
Dim pn As New Pen(Color.red,2)
Dim pn1 As New Pen(Color.LightGray,2)
pn1.DashStyle = DashStyle.DashDotDot
Dim fnt As New Font("宋体",8,FontStyle.Regular)
e.StartDraw()
Dim w,h,ks,kshx,dgc,qthx,qtks,rx,ry,x,y As Single
h = e.Row("高")
w = e.Row("宽") '长方形宽
ks = e.Row("开数")
kshx = e.Row("开数划线")
dgc = e.Row("吊管长")
qthx = e.Row("气头划线")
qtks = e.Row("气头空数")
g.DrawRectangle(pn,e.x+35,e.y+15, w/10, h/10) '绘制长方形
g.DrawString(h,fnt,Brushes.RoyalBlue,w/20+e.x,h/10+19+e.y)
g.DrawString(w,fnt,Brushes.RoyalBlue,w/10+39+e.x,h/20+e.y)
If qtks >0
'绘制角线
g.DrawLine(pn,e.x+35,e.y+15+dgc/10,e.x+35+w/10,e.y+15+dgc/10)
If qtks > 3 Then
g.DrawLine(pn,e.x+35+qthx/10,e.y+15,e.x+35+qthx/10,e.y+15+dgc/10)
g.DrawLine(pn,e.x+35+2*qthx/10,e.y+15,e.x+35+2*qthx/10,e.y+15+dgc/10)
g.DrawLine(pn,e.x+35+3*qthx/10,e.y+15,e.x+35+3*qthx/10,e.y+15+dgc/10)
Else
If qtks > 2
g.DrawLine(pn,e.x+35+qthx/10,e.y+15,e.x+35+qthx/10,e.y+15+dgc/10)
g.DrawLine(pn,e.x+35+2*qthx/10,e.y+15,e.x+35+2*qthx/10,e.y+15+dgc/10)
Else
If qtks > 1
g.DrawLine(pn,e.x+35+qthx/10,e.y+15,e.x+35+qthx/10,e.y+15+dgc/10)
e.EndDraw()
End If
End If
End If
End If
End If