Article View: free.it.visual-basic
Article #540Re: Contatore!
From: AgoZx
Date: Sun, 13 Nov 2005 09:22
Date: Sun, 13 Nov 2005 09:22
56 lines
2576 bytes
2576 bytes
"AgoZx" <Agozx@agozx.it> ha scritto nel messaggio
news:5vDdf.58845$Pe2.1099201@twister2.libero.it...
>
> Copia questo codice in un form, aggiungi un controllo Timer e una
> Command-Button, dovrebbe funzionare.
> Ciao.
>
> '****************************************
> Option Explicit
> Public Ore As Integer
> Public Minuti As Integer
> Public Secondi As Integer
> '*************************************
> Private Sub Command1_Click()
> Unload Me
> End
> End Sub
> '************************************
>
> Private Sub Form_Load()
> Timer1.Interval = 1000 'Imposta il Timer a 1 secondo
> Timer1.Enabled = True
> Label1.Caption = "Timer "
> Label1.AutoSize = True
> Ore = 0
> Minuti = 0
> Secondi = 0
> End Sub
>
> '*******************************************
> Private Sub Timer1_Timer()
> 'questa sub viene chiamata ad ogni secondo
> Secondi = Secondi + 1
> If Secondi = 60 Then
> Minuti = Minuti + 1
> If Minuti = 60 Then
> Ore = Ore + 1
> Minuti = 0
> End If
> Secondi = 0
> End If
'Scusa dimenticavo i 15 minuti.
'incolla questo frammento di codice.
If Minuti = 15 Then
MsgBox "Tempo Scaduto!!"
End If
> Label1.Caption = " Ore : " & Ore & vbCrLf _
> & " Minuti : " & Minuti & vbCrLf _
> & " Secondi : " & Secondi
> End Sub
>
> '*******************************************
Technical Details
Message-ID:
<LBDdf.35884$65.1091309@twister1.libero.it>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!nntp.infostrada.it!twister1.libero.it.POSTED!not-for-mailReferences:
<4374f42a$0$16217$4fafbaef@reader3.news.tin.it> <5vDdf.58845$Pe2.1099201@twister2.libero.it>Show Full Headers
Complete Article Headers
X-Google-Thread: f94ee,4f8ee382fee07b75 X-Google-Attributes: gidf94ee,public X-Google-Language: ITALIAN,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!nntp.infostrada.it!twister1.libero.it.POSTED!not-for-mail From: "AgoZx" <Agozx@agozx.it> Newsgroups: free.it.visual-basic References: <4374f42a$0$16217$4fafbaef@reader3.news.tin.it> <5vDdf.58845$Pe2.1099201@twister2.libero.it> Subject: Re: Contatore! Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response Message-ID: <LBDdf.35884$65.1091309@twister1.libero.it> Date: Sun, 13 Nov 2005 09:22:51 GMT NNTP-Posting-Host: 151.27.25.174 X-Complaints-To: abuse@libero.it X-Trace: twister1.libero.it 1131873771 151.27.25.174 (Sun, 13 Nov 2005 10:22:51 MET) NNTP-Posting-Date: Sun, 13 Nov 2005 10:22:51 MET Organization: [Infostrada]