Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi.

 

I have a function, which is called many times (unknown number)

 

I want to make something during the �call� of the function. Some loading label for user to wait for data.

 

All I want to know is when the calling is over for that particularly function the label to go invisible and when is called again to turn visibility on.

 

I made something whit odd/even numbers, but obvious is not working because the last number in contor can't always be odd

 


Public Sub loading()

       contor = contor + 1

       If contor Mod 2 Then
           rosu.Text = "LOADING..."
       Else
           rosu.Text = ""
       End If


   End Sub

 

Thanks

Posted

I don't understand your problem.

 

Why don't you set the label visible in the first line of code in the sub und set it invisible in the last ?

.nerd
Posted

The function is called when I receive data from the RS232. So I don�t know how much info I�ll receive to put a max value.

 

Heiko >> you idea doesn�t seems to work. L

 

 

When I press the get status from RS232 I want to have some �animation� until the receiving is over, that�s all I want.

Posted

I see now.

 

When *you* can't tell when the receiving is over, how can the program ?

 

The only possibility I see is that you define a max idle time.

 

then set up a timer that (re)starts running whenever the sub is called. In the sub set the label visible, too.

 

Set the Timer interval to your max idletime.

 

In the tick event handler, let the label dissapear and stop the

timer.

.nerd
Posted

thanks

 

based on your ideea I put "label off" in my timer tick event .

 

So now I have visible in my function and hide in my tick event. Is exactly want I wanted. :) .. because the timer tick is always, the label will be off when the receiving is over.

 

thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...