Re: why won't this work!!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Rick Rothstein (rickNOSPAMnews_at_NOSPAMcomcast.net)
Date: 08/18/04


Date: Wed, 18 Aug 2004 04:42:51 -0400


> This program is supposed to let you input variables and then click a
flip
> button to see whether a coin will land heads or tails. All the
variables such
> as height, speed and the number of flips are updated every second
until the
> coin lands. After the coin lands the program determines whether it is
heads
> or tails, then displays the answers in a label. The only thing that
updates
> however is the caption showing heads or tails, which changes every
second to
> add a slot machine type effect to the program. Why does the height,
speed and
> # of flips not update? The equations seem to work at least once, even
though
> the caption changes from heads to tails every second, so i know the
program
> runs through this code every 1000 intervals.
>
> ...........<snip>............
>
> vHeight.Caption = nDistance
> vSpeed.Caption = nSpeed
> Flips.Caption = nFlips

I didn't try your code out, but what happens if you Refresh these Labels
each time?

vHeight.Caption = nDistance
vHeight.Refresh
vSpeed.Caption = nSpeed
vSpeed.Refresh
Flips.Caption = nFlips
Flips.Refresh

Rick - MVP


Quantcast