矩形填充样式 HatchStyle

       

Private Sub DrawCell(ByVal iIndex As Int16, ByVal eStyle As HatchStyle, ByVal s As String)
        Const cW = 100
        Const cCol = 10

        Dim iX As Int16
        Dim iY As Int16
        Dim iW As Int16

        Dim g As Graphics
        Dim tempbrush As Brush

        g = Me.CreateGraphics

        iW = Me.Width / cCol

        iX = iIndex Mod cCol
        iY = iIndex / cCol

        iX = iX * iW
        iY = iY * (cW + 30)

        tempbrush = New HatchBrush(eStyle, Color.Blue, Color.Beige)

        '声明并初始化了一个有着蓝色交叉阴影、米色背景的画刷
        g.FillRectangle(tempbrush, iX, iY, cW, cW)
        '使用该画刷填充矩形
        g.DrawRectangle(Pens.Blue, iX, iY, cW, cW)

        g.DrawString(s, Me.Font, Brushes.Blue, iX, iY + cW)

    End Sub

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页