home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / PERMETER.ZIP / METER.TXT < prev    next >
Text File  |  1994-03-02  |  2KB  |  41 lines

  1. This is a sample on how to make a percent bar in your VB apps without 
  2. using third party add ons. This is a basic sample that is designed to 
  3. get you going.
  4.  
  5. The code contains a sub called FillMeter which has 2 parameters passed 
  6. to it, the total and the value to update to. The total is the value that 
  7. will show "100%" in the percent bar. Example- if you are going to 
  8. process a list box that contains 15 items , then the total would be 15, 
  9. or if you are going to call 4 subs or functions, the total would be 4. 
  10. The value is the aamount to update to. Example- if you have a list box 
  11. with 15 items and you are processing the 2nd item, the value would be 2, 
  12. or if you are going to call 4 subs or functions and you are current on 
  13. the 2nd sub, your value would be 2.
  14.  
  15. FillMeter will calculate the length of the line to draw by using these 
  16. values. Example- If your total is 15 and you pass a value of 5 to update 
  17. to, then 5/15 would be approx. .15 or 15%. Then it draws a line that is 
  18. 15% of the width of the percent bar.
  19.  
  20. The percent bar is a simple picture box that has the FontTransparent set 
  21. to false. If this were set to true, then each time you printed the value 
  22. of the percent (ex. "15 %") in the percent bar, it would overlap the 
  23. previous value. (To see this , set the FontTransparent to true and run 
  24. the code). At about 45% we can change the font to transparent because 
  25. the line being drawn will correct this (again try this out in the code 
  26. to see the difference).You can get around this be clearing the picture box
  27. before you draw the line, but this causes alot of screen flutter (Try it out
  28. to see).
  29.  
  30. When the value hits 100%, we then change the FontTransparent back to 
  31. false and clear the picture box.
  32.  
  33. The code contains to sample of using the percent sample, a simple timer 
  34. and a sample of using listboxes. This again is just a basic start, you 
  35. can modify it for your own needs.
  36.  
  37. Thats about it, you are allowed to modify this code any way you wish and 
  38. use it as long as you remember one thing, "I CAN NOT BE HELD 
  39. RESPONSIBLE FOR ANY DAMAGE CAUSED BY THIS CODE". Pretty basic 
  40. disclaimer, have fun and enjoy it!
  41.