PC Review


Reply
Thread Tools Rate Thread

i can't get countdown.....

 
 
Supra
Guest
Posts: n/a
 
      14th Aug 2005
i can't get countdown timer working in webform.....

Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnStart.Click
Dim rnd1 As New Random
lblMin.Text = Int(rnd1.Next(15, 30))
lblSec.Text = Int(rnd1.Next(1, 60))
tmrSuduko.Enabled = True
tmrSuduko.AutoReset = True
end sub

Private Sub tmrSuduko_Elapsed(ByVal sender As System.Object, ByVal e As
System.Timers.ElapsedEventArgs) Handles tmrSuduko.Elapsed
tmrSuduko.Enabled = True
If Format(sT, "mm") & " : " & Format(sT, "ss") <> "00 : 00" Then
sT = DateAdd(DateInterval.Second, -1, sT)
lblTimeLeft.Text = "Time left : " & Format(sT, "mm") & " :
" & Format(sT, "ss")
tmrSuduko.AutoReset = True
tmrSuduko.Enabled = True
Else
End If
End Sub

i don't know anything about Elapsed keyword. work!!!!!!
regards
 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      14th Aug 2005
Supra,

Why you start a new message thread,

Please stay in the same message thread, otherwise we start new.

I gave you an answer and you ignore that completly

Cor


 
Reply With Quote
 
Supra
Guest
Posts: n/a
 
      14th Aug 2005
'm starting webform project. i am almost finished suduko project from
vb.net. now in webform...i don't know how what to start with imports....
i dragged timer webform compoent tab to webpage and :-( .

Option Explicit On
Option Strict Off
Imports System.Timers.Timer
Public Class webSuduko
Inherits System.Web.UI.Page
\\
\\
\\
end class
in webform component tab i can see timer control of toolbox but not on
weform tab tof toolbox..
if ne 1 wants to test my suduko.exe. please feel free and do not
hesitate to ask newsgroup 8-)
regards,

Cor Ligthert [MVP] wrote:

>Supra,
>
>Why you start a new message thread,
>
>Please stay in the same message thread, otherwise we start new.
>
>I gave you an answer and you ignore that completly
>
>Cor
>
>
>
>


 
Reply With Quote
 
Supra
Guest
Posts: n/a
 
      14th Aug 2005
where do i put it?..... i got both displayed showinb but not counting
down. i put this code in button click event
regards

Dim scriptString As String = "<script language=JavaScript>" & _
"setclock(); function setclock(){document.images.Image1.src = " & _
"'http://localhost/WebClock/WebForm2.aspx';setTimeout('setclock()',1000)}</script>"
Page.RegisterStartupScript("setclock", scriptString)



Cor Ligthert [MVP] wrote:

>Supra,
>
>Why you start a new message thread,
>
>Please stay in the same message thread, otherwise we start new.
>
>I gave you an answer and you ignore that completly
>
>Cor
>
>
>
>

 
Reply With Quote
 
m.posseth
Guest
Posts: n/a
 
      14th Aug 2005
Hi Supra,,,


what you want can`t be done from the server side ,,,

however as Cor tried to explain to you this can be done with some client
side script


i have prepared a small demo for you

open a new webform , throw a label on this webform

now in the page load event paste this code

Dim counter As Integer

If IsNothing(Session.Item("counter")) Then

Session.Item("counter") = 0

Else

counter = (Session.Item("counter"))

counter += 1

Session.Item("counter") = counter

End If

If counter <= 9 Then

Dim script As String = "<script language=""JavaScript"">" & _

"setTimeout('window.location.href=window.location.href',1000)</script>"

Page.RegisterStartupScript("refresh", script)

Label1.Text = String.Concat("counting : ", counter.ToString)

ElseIf counter = 10 Then

Label1.Text = String.Concat("well i just counted to ", counter.ToString, " i
feel that this is enough for today")

End If


this will show a counter that stops at 10

i hope this will give you an idea ,

regards

Michel Posseth



"Supra" <(E-Mail Removed)> wrote in message
news:cOmdnUYjgM84DmLfRVn-(E-Mail Removed)...
> where do i put it?..... i got both displayed showinb but not counting
> down. i put this code in button click event
> regards
>
> Dim scriptString As String = "<script language=JavaScript>" & _
> "setclock(); function setclock(){document.images.Image1.src = " & _
>
> "'http://localhost/WebClock/WebForm2.aspx';setTimeout('setclock()',1000)}</script>"
> Page.RegisterStartupScript("setclock", scriptString)
>
>
>
> Cor Ligthert [MVP] wrote:
>
>>Supra,
>>
>>Why you start a new message thread,
>>
>>Please stay in the same message thread, otherwise we start new.
>>
>>I gave you an answer and you ignore that completly
>>
>>Cor
>>
>>



 
Reply With Quote
 
Supra
Guest
Posts: n/a
 
      15th Aug 2005
now i understsood =-O . i am attempting how to get time remaining.
start time : 10 :38
time left : 10: 37

i will try to do this from cor example.
regards


m.posseth wrote:

>Hi Supra,,,
>
>
>what you want can`t be done from the server side ,,,
>
>however as Cor tried to explain to you this can be done with some client
>side script
>
>
>i have prepared a small demo for you
>
>open a new webform , throw a label on this webform
>
>now in the page load event paste this code
>
>Dim counter As Integer
>
>If IsNothing(Session.Item("counter")) Then
>
>Session.Item("counter") = 0
>
>Else
>
>counter = (Session.Item("counter"))
>
>counter += 1
>
>Session.Item("counter") = counter
>
>End If
>
>If counter <= 9 Then
>
>Dim script As String = "<script language=""JavaScript"">" & _
>
>"setTimeout('window.location.href=window.location.href',1000)</script>"
>
>Page.RegisterStartupScript("refresh", script)
>
>Label1.Text = String.Concat("counting : ", counter.ToString)
>
>ElseIf counter = 10 Then
>
>Label1.Text = String.Concat("well i just counted to ", counter.ToString, " i
>feel that this is enough for today")
>
>End If
>
>
>this will show a counter that stops at 10
>
>i hope this will give you an idea ,
>
>regards
>
>Michel Posseth
>
>
>
>"Supra" <(E-Mail Removed)> wrote in message
>news:cOmdnUYjgM84DmLfRVn-(E-Mail Removed)...
>
>
>>where do i put it?..... i got both displayed showinb but not counting
>>down. i put this code in button click event
>>regards
>>
>>Dim scriptString As String = "<script language=JavaScript>" & _
>> "setclock(); function setclock(){document.images.Image1.src = " & _
>>
>>"'http://localhost/WebClock/WebForm2.aspx';setTimeout('setclock()',1000)}</script>"
>> Page.RegisterStartupScript("setclock", scriptString)
>>
>>
>>
>>Cor Ligthert [MVP] wrote:
>>
>>
>>
>>>Supra,
>>>
>>>Why you start a new message thread,
>>>
>>>Please stay in the same message thread, otherwise we start new.
>>>
>>>I gave you an answer and you ignore that completly
>>>
>>>Cor
>>>
>>>
>>>
>>>

>
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up countdown timer to countdown days to a specific day Jenny Microsoft Excel Worksheet Functions 2 28th Jun 2009 04:42 PM
Countdown simserob Microsoft Excel Worksheet Functions 5 22nd Jul 2006 02:40 AM
Countdown simserob Microsoft Excel Worksheet Functions 0 21st Jul 2006 06:26 PM
60 second countdown =?Utf-8?B?c3RldmVubWF1cnk=?= Windows XP Hardware 16 27th Jun 2005 03:01 PM
COUNTDOWN Bruce Stokes Windows XP General 2 15th Sep 2004 02:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:58 PM.