I want it to be able to give a percentage of RAM free, based on total amount of RAM and amount of RAM free. (for example, a system with 128MB RAM has say 20MB RAM free - how can you work out a percentage in VB to put in say, a progress bar?)
When you already have these two values do it with Microsoft Common Controls 1.
Add a ProgressBar and a Command Button to your form...
Code:
Private Sub Command1_Click()
Dim memFree As Single
Dim memTotal As Single
'--> here you should get the amount of memory... ;-)
Dim percent As Single
percent = memFree / memTotal * 100
ProgressBar1.Max = 100
ProgressBar1.Value = percent
End Sub
Hope this helps,
Dennis.
Last edited by dmr; Apr 8th, 2001 at 03:30 PM.
Code that I author is neither elegant nor efficient. It is, however, functional. Once I get something that works, I'm generally satisfied with myself - I mean, if it works, that's good enough, right?
Originally posted by aknisely Sorry, but I feel uncomfortable on CC with clothes on