Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

How to calculate a value depending on width of Form

$
0
0
I have a Form that shows a progress bar like (not a real progress bar) motion that prints a certain number of repetitive characters across the width of a Statusbar. The number of characters that it will print is based on a numeric value that represents the number of times the character is to be printed. The characters should be printed to the end of the Statusbar at which time the allowed time it took to print these characters has elapsed and then it starts over again.

As an example. If the width of the Form is 6780 (minimum width allowed) then maximum number of characters to print is 110. This value will allow the characters to print to the end of the Statusbar for this particular Form width. Another example. If the width of the Form is 9390 then the value is 170 (just an approximation but close).

I know these two values because I experimented with them until it came out correct.

As the Form is resized I need to change this value in relations the the width of the Form so that no matter what the width is the number of characters to be printed will always reach to the end of the Statusbar (give or take a character doesn't matter) and then the Statusbar is cleared and the process starts over again.

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>