Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make label flash whilst a spcific piece of code is runing

Status
Not open for further replies.

DevelopV

Technical User
Mar 16, 2012
113
ZA
Whilst a specific section of code is being run I want to make a label appear to flash
eg.
some code label does not flash
more code label flashes
some code label does not flash

I assume that I use the forms timer event but I can't get it to work.

How do I do this?

Many thanks in advance
 
Hi,

What have you tried and what were the results?

Pls post your code.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Code:
For varItem = 0 To Me.lstAvialableFilesForUpload.ListCount - 1
    Me.lblFileBeingTransferred.Caption = "Copying file:  " & Me.lstAvialableFilesForUpload.Column(0, varItem) & "      File " & i & " of " & lstCount
    Form_Timer
    FileToCopyFrom = pubWebOrderUploadDataFromLocalFolder & "\" & Me.lstAvialableFilesForUpload.Column(0, varItem)
    FileToCopyTo = pubWebOrderUploadDataToInternetFolder & "/" & Me.lstAvialableFilesForUpload.Column(0, varItem)
    PutFileUsingFTP pubInternetDomainName, pubInternetFTPUserName, pubInternetFTPPassword, FileToCopyFrom, FileToCopyTo
    i = i + 1
Next
Me.TimerInterval = 0

Code:
Private Sub Form_Timer()

Me.TimerInterval = 300

If Me.lblFileBeingTransferred.Visible = True Then
Me.lblFileBeingTransferred.Visible = False
Else
Me.lblFileBeingTransferred.Visible = True

End If
End Sub
 
I'd try this:
Code:
Me.TimerInterval = 300
For varItem = 0 To Me.lstAvialableFilesForUpload.ListCount - 1
    Me.lblFileBeingTransferred.Caption = "Copying file:  " & Me.lstAvialableFilesForUpload.Column(0, varItem) & "      File " & i & " of " & lstCount
    FileToCopyFrom = pubWebOrderUploadDataFromLocalFolder & "\" & Me.lstAvialableFilesForUpload.Column(0, varItem)
    FileToCopyTo = pubWebOrderUploadDataToInternetFolder & "/" & Me.lstAvialableFilesForUpload.Column(0, varItem)
    PutFileUsingFTP pubInternetDomainName, pubInternetFTPUserName, pubInternetFTPPassword, FileToCopyFrom, FileToCopyTo
    i = i + 1
Next
Me.TimerInterval = 0

Code:
Private Sub Form_Timer()
Me.lblFileBeingTransferred.Visible = Not Me.lblFileBeingTransferred.Visible
End Sub

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PH

A lot neater than mine, but the label still does not flash
 
What happens if you add a DoEvents call inside your loop?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
BTW, I forget to add this line at the end of the Timer event procedure:
Me.Repaint

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top