how to display a label only a while?

  • Thread starter Thread starter Cas
  • Start date Start date
C

Cas

Hi,

I want to display a label a few seconds, then make it invisible.
I tried with for next, but it doesn't work.

Thanks for help
Cas
 
Hi Cas,

it would work if you placed an application.doevents()
within the loop. But do not do it.

Place a timer and take care of the label when the
first event fires. Then you can disable or dispose the timer.

Tommaso

Cas ha scritto:
 
Hi, thanks for replying ..

I tried this but the label doesn't appear: (the label must appear 3 seconds
when the record is inserted in the detailsview).

Do you see the error?
Thanks again

Protected Sub DetailsView1_ItemInserted(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewInsertedEventArgs) Handles
DetailsView1.ItemInserted
Dim t As New Timers.Timer(3000)
AddHandler t.Elapsed, AddressOf TimerFired
t.Enabled = True
End Sub

Public Sub TimerFired(ByVal sender As Object, _
ByVal e As System.Timers.ElapsedEventArgs)
Label1.Text = "yes!"
End Sub
 
I thought you were talking about a win application.

On web apps the events are done on the server. So if there
is no postback you will not see the result.

Tommaso

Cas ha scritto:
 
Back
Top