Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Annoying but probably easily solved loop question
Old
  (#1)
John
Guest
 
Posts: n/a
Default Annoying but probably easily solved loop question - 06-04-2007, 08:51 AM

Hi there folks...

Just wondering if someone can help a newbie to VB!?

I'm running some stuff in a For loop. Each time the loop runs it makes
a change to a value which it should display in a label. My problem is
that when I run the loop, say 100 times, the label only shows the
100th change. It doesn't update the label every time the change has
been made! I realise that what I want the VB to do sounds pointless in
that the label would change so fast that it wouldnt be readable... BUT
once I get this working I intend to make the label a coloured box that
doesnt show the value, but a colour indicating the range that the
value is in. By my reckoning, the way I have it now would make it only
show the colour of the last value updated before the loop exited.

Any help would be gratefully recieved.

John
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Annoying but probably easily solved loop question
Old
  (#2)
Norman Yuan
Guest
 
Posts: n/a
Default Re: Annoying but probably easily solved loop question - 06-04-2007, 08:51 AM

Add Label.Refresh after you set Label's caption a new text.

Screen refreshing is a resource-hangry process and the OS (Windows) gives it
low CPU priority unless your code demands it (Label.Refresh).

"John" <EMAIL REMOVED> wrote in message
news:EMAIL REMOVED om...
> Hi there folks...
>
> Just wondering if someone can help a newbie to VB!?
>
> I'm running some stuff in a For loop. Each time the loop runs it makes
> a change to a value which it should display in a label. My problem is
> that when I run the loop, say 100 times, the label only shows the
> 100th change. It doesn't update the label every time the change has
> been made! I realise that what I want the VB to do sounds pointless in
> that the label would change so fast that it wouldnt be readable... BUT
> once I get this working I intend to make the label a coloured box that
> doesnt show the value, but a colour indicating the range that the
> value is in. By my reckoning, the way I have it now would make it only
> show the colour of the last value updated before the loop exited.
>
> Any help would be gratefully recieved.
>
> John



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Annoying but probably easily solved loop question
Old
  (#3)
J French
Guest
 
Posts: n/a
Default Re: Annoying but probably easily solved loop question - 06-04-2007, 08:51 AM

On 24 Nov 2003 10:41:39 -0800, EMAIL REMOVED (John) wrote:

>Hi there folks...
>
>Just wondering if someone can help a newbie to VB!?
>
>I'm running some stuff in a For loop. Each time the loop runs it makes
>a change to a value which it should display in a label. My problem is
>that when I run the loop, say 100 times, the label only shows the
>100th change. It doesn't update the label every time the change has
>been made! I realise that what I want the VB to do sounds pointless in
>that the label would change so fast that it wouldnt be readable... BUT
>once I get this working I intend to make the label a coloured box that
>doesnt show the value, but a colour indicating the range that the
>value is in. By my reckoning, the way I have it now would make it only
>show the colour of the last value updated before the loop exited.
>
>Any help would be gratefully recieved.


Label1.Refresh
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top