VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



FIXEDPercent Bar Without a VBX

by Worm (2 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

This function will let you make a percent bar without a vbx. Now you don't have to add a vbx to your program making it a bigger hassle, plus you can now pick any color percent bar you want

API Declarations
Sub precentworm (picture As Control, ByVal percent)
Dim num$
If Not picture.AutoRedraw Then
picture.AutoRedraw = -1
End If
picture.Cls
picture.ScaleWidth = 100
picture.DrawMode = 10
num$ = Format$(percent, "###") + "%"
picture.CurrentX = 50 - picture.TextWidth(num$) / 2
picture.CurrentY = (picture.ScaleHeight - picture.TextHeight(num$)) / 2
picture.Print num$
picture.Line (0, 0)-(percent, picture.ScaleHeight), , BF
picture.Refresh
End Sub

Rate FIXEDPercent Bar Without a VBX

'Put this in a command button or any control you want
picture1.ForeColor = RGB(0, 0, 255) 'blue bar but you can change it
For i = 0 To 100 Step 2
precentworm picture1, i
Next
picture.Cls

Download this snippet    Add to My Saved Code

FIXEDPercent Bar Without a VBX Comments

No comments have been posted about FIXEDPercent Bar Without a VBX. Why not be the first to post a comment about FIXEDPercent Bar Without a VBX.

Post your comment

Subject:
Message:
0/1000 characters