Home All Groups Group Topic Archive Search About

how to display a label only a while?

Author
21 Aug 2006 5:32 PM
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

Author
21 Aug 2006 5:48 PM
tommaso.gastaldi@uniroma1.it
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:

Show quoteHide quote
> 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
Author
21 Aug 2006 6:48 PM
Cas
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



<tommaso.gasta***@uniroma1.it> schreef in bericht
Show quoteHide quote
news:1156182496.466894.314310@74g2000cwt.googlegroups.com...
> 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,
>>
>> 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
>
Author
21 Aug 2006 7:34 PM
tommaso.gastaldi@uniroma1.it
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:

Show quoteHide quote
> 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
>
>
>
> <tommaso.gasta***@uniroma1.it> schreef in bericht
> news:1156182496.466894.314310@74g2000cwt.googlegroups.com...
> > 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,
> >>
> >> 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
> >