🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #539

Re: Contatore!

#539
From: AgoZx
Date: Sun, 13 Nov 2005 09:15
53 lines
2443 bytes
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

   Label1.Caption = "     Ore : " & Ore & vbCrLf _
                  & "  Minuti : " & Minuti & vbCrLf _
                  & " Secondi : " & Secondi
End Sub

'*******************************************

"Antonio Rossetti" <antonio.rossetti@libero.it> ha scritto nel messaggio 
news:4374f42a$0$16217$4fafbaef@reader3.news.tin.it...
> Come posso fare a visualizzare in una label un contatore che parte da 0 e 
> conta i minuti? Vorrei fare in modo che appaia un msg quando si superano i 
> 15 min. Grazie per l'aiuto.
> 
Technical Details
Message-ID: <5vDdf.58845$Pe2.1099201@twister2.libero.it>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.x-privat.net!news.panservice.it!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mail
References: <4374f42a$0$16217$4fafbaef@reader3.news.tin.it>

Show Full Headers
Complete Article Headers
X-Google-Thread: f94ee,4f8ee382fee07b75
X-Google-Attributes: gidf94ee,public
X-Google-Language: ITALIAN,ASCII-7-bit
From: "AgoZx" <Agozx@agozx.it>
Newsgroups: free.it.visual-basic
References: <4374f42a$0$16217$4fafbaef@reader3.news.tin.it>
Subject: Re: Contatore!
Lines: 55
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: <5vDdf.58845$Pe2.1099201@twister2.libero.it>
Date: Sun, 13 Nov 2005 09:15:45 GMT
NNTP-Posting-Host: 151.27.25.174
X-Complaints-To: abuse@libero.it
X-Trace: twister2.libero.it 1131873345 151.27.25.174 (Sun, 13 Nov 2005 10:15:45 MET)
NNTP-Posting-Date: Sun, 13 Nov 2005 10:15:45 MET
Organization: [Infostrada]
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.x-privat.net!news.panservice.it!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mail