Foxtable(狐表)用户栏目专家坐堂 → 金额头怎么实现呢?


  共有3271人关注过本帖平板打印复制链接

主题:金额头怎么实现呢?

帅哥哟,离线,有人找我吗?
nxhylczh
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:335 积分:2674 威望:0 精华:0 注册:2018/11/22 9:19:00
  发帖心情 Post By:2021/1/27 18:30:00 [只看该作者]

老师,我写的是财务软件,这个金额头对我来说非常重要。还有其他办法实现吗?
这是我原来用FlexCell实现的
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

 回到顶部
总数 19 1 2 下一页