From: Harvey Triana on
Sorry

Private Const DELAY As Double = 600 '//10 minutes



"Harvey Triana" <harveytriana(a)hotmail.com> escribi? en el mensaje
news:Oej7us$KGHA.2320(a)TK2MSFTNGP11.phx.gbl...
>> The timer control is limited to 65 seconds. If you need longer times
>> than
>> that, you need to use the API SetTimer function.
>
> Not always. The next sample is a timer over ten minutes... or you like
>
> Option Explicit
>
> Private t As Date
>
> Private Const DELAY As Double = 10 '//minutes
>
> Private Sub Form_Load()
> t = Now
> Timer1.Interval = 1000
> Timer1.Enabled = True
> End Sub
>
> Private Sub Timer1_Timer()
> If Abs(DateDiff("s", t, Now)) >= DELAY Then
> Timer1.Enabled = False
> MsgBox "Do Something"
> End If
> End Sub
>
> <Harvey Triana />
> Drilling View? Developer (52 oil wells in 2005)
> ---------------------
> Of course:
> http://classicvb.org/petition/index.asp
>
> ----- Original Message -----
> From: "Michael D. Ober" <obermd.@.alum.mit.edu.nospam>
> Newsgroups: microsoft.public.vb.general.discussion
> Sent: Monday, February 06, 2006 10:04 PM
> Subject: Re: SetTimer vs. Timer Control
>
>


From: Desi on
Thanks for the replies fellas.

Hmmm. I guess the long and the short of it is that it wouldn't hurt me to
learn a new trick.
Am kind of leary of the caveat that goes along with using the SetTimer and
KillTimer API calls though.
The easy way ain't necessarily the best way!

Thanks again!

Desi


From: Ken Halter on
"Desi" <nospam(a)thanks.net> wrote in message
news:ZF8Gf.266$xb.1918(a)eagle.america.net...
> Thanks for the replies fellas.
>
> Hmmm. I guess the long and the short of it is that it wouldn't hurt me to
> learn a new trick.
> Am kind of leary of the caveat that goes along with using the SetTimer and
> KillTimer API calls though.
> The easy way ain't necessarily the best way!
>
> Thanks again!
>
> Desi

If using SetTimer or any API that requires callbacks, just make sure you
have a way to shut down the app other than using VB's stop button.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Freeware 4 color Gradient Frame? http://www.vbsight.com/GradFrameCTL.htm


From: Tom Esh on
On Tue, 7 Feb 2006 15:55:24 -0600, "Desi" <nospam(a)thanks.net> wrote:

>Thanks for the replies fellas.
>
>Hmmm. I guess the long and the short of it is that it wouldn't hurt me to
>learn a new trick.
>Am kind of leary of the caveat that goes along with using the SetTimer and
>KillTimer API calls though.
>The easy way ain't necessarily the best way!

....And sometimes it ~is~ :-)
By all means use a Timer control if you're not comfortable with
SetTimer. Perhaps get familiar with it in a simpler context first -
and save it for the next version of your component. Don't let us
hardcore Api types lead you over the brink. <g>


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
From: Desi on

"Tom Esh" <tjeshGibberish(a)suscom.net> wrote in message
news:9r6iu1heianufkreuh0ffrta1moagugkjd(a)4ax.com...
> On Tue, 7 Feb 2006 15:55:24 -0600, "Desi" <nospam(a)thanks.net> wrote:
>
> Don't let us hardcore Api types lead you over the brink. <g>
>
>
> -Tom

Isn't that where the fun is though!

Desi


First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: datacombo
Next: Shutdown dialog Box