龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VB开发 >

利用VB2005制作颜色渐变的进度条[组图](8)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
每个画笔填充颜色占用的宽度 height = CSng(Me.ClientRectangle.Height - BorderWidth) 根据当前百分比所占用的宽度使用画笔填充颜色 For x = halfBorder To totalWidth Step bar

        '每个画笔填充颜色占用的宽度

        height = CSng(Me.ClientRectangle.Height - BorderWidth) 

        '根据当前百分比所占用的宽度使用画笔填充颜色

        For x = halfBorder To totalWidth Step barWidth

            e.Graphics.FillRectangle(lstBrushes(idxColor), x, halfBorder, barWidth, height)

            If idxColor < lstBrushes.Count Then

                idxColor += 1

            End If

        Next

        '当进度为100%的,使用最后一个画笔填充颜色.

        If (x < (Me.ClientRectangle.Width - halfBorder)) And percentComplete = 1.0 Then

            If idxColor < lstBrushes.Count Then

                e.Graphics.FillRectangle(lstBrushes(idxColor), x, halfBorder, ((Me.ClientRectangle.Width - halfBorder) - x), height)

            End If

        End If

    End Sub

End Class

收藏文章
表情删除后不可恢复,是否删除
取消
确定
图片正在上传,请稍后...
评论内容为空!
还没有评论,快来抢沙发吧!

热评话题

按钮 内容不能为空!
立刻说两句吧! 查看0条评论
精彩图集

赞助商链接