Public Sub 金额头(Grid As FlexCell.Grid, iCol As Long, iRow As Long, sTyle As Integer, ByVal Row As Long, ByVal Col As Long, ByVal hdc As Long, ByVal Left As Long, ByVal Top As Long, ByVal Right As Long, ByVal Bottom As Long, Handled As Boolean)
Dim i As Integer
Dim intSpace As Integer
Dim intLen As Integer
Dim rcText As RECT
'iCol 要画线的列
'irow 要画线的行
Grid.AutoRedraw = False
If Col = iCol Then
If Row = iRow Then
intSpace = Grid.Column(iCol).Width / 14
'单个字符(亿、万、仟、佰、拾、元、角、分)
rcText.Top = Top
rcText.Bottom = Bottom
rcText.Left = Left
rcText.Right = Left + 7 * intSpace + 1
DrawText hdc, "亿", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 7 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "万", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 8 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "仟", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 9 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "佰", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 10 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "拾", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 11 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "元", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 12 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "角", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 13 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "分", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
'(仟万、佰万、拾万)的上半部分
rcText.Top = Top
rcText.Bottom = Bottom
rcText.Left = Left + 4 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "仟", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 5 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "佰", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
rcText.Left = Left + 6 * intSpace + 1
rcText.Right = rcText.Left + intSpace
DrawText hdc, "拾", 2, rcText, DT_SINGLELINE Or DT_CENTER Or DT_VCENTER
'框线
For i = 1 To 14
Select Case i
Case 1, 2, 4, 5, 7, 8, 10, 11, 13
DrawLine hdc, Left + i * intSpace, Top, Left + i * intSpace, Bottom, RGB(90, 158, 214)
Case 3, 6, 9
DrawLine hdc, Left + i * intSpace, Top, Left + i * intSpace, Bottom, &H800000
Case 12
DrawLine hdc, Left + i * intSpace, Top, Left + i * intSpace, Bottom, vbRed
' Case 14
' DrawLine hDC, Left + i * intSpace, Top, Left + i * intSpace, Bottom, vbBlack
End Select
Next
Handled = True
End If
End If
Grid.AutoRedraw = True
End Sub