سلام چگونه بدون استفاده از تایمر یک کورنومتر بسازم؟؟
:46:
---------- Post added at 10:44 PM ---------- Previous post was at 10:41 PM ----------
آیا می شه زمان فعلی کامپیوتر رو از زمانی که کورنومتر شروع می شه کم کرد؟
Printable View
سلام چگونه بدون استفاده از تایمر یک کورنومتر بسازم؟؟
:46:
---------- Post added at 10:44 PM ---------- Previous post was at 10:41 PM ----------
آیا می شه زمان فعلی کامپیوتر رو از زمانی که کورنومتر شروع می شه کم کرد؟
آره
با توابع api راحته ولی ممکنه دقیق نباشه.
بدون استفاده از تایمر ؟ با حلقه ی For و Do نمیشه ... چون اونها نتیجه رو حساب میکنن !نقل قول:
ولی با استفاده از تایمر من براتون نوشتم ... بفرمایید :
کد:Dim a As Integer
Dim b As Integer
Dim c As Integer
Private Sub Form_Load()
Timer1.Interval = 10
a = 0
b = 0
c = 0
End Sub
Private Sub Timer1_Timer()
If c >= 0 Then
Label1.Caption = a & ":" & b & ":" & c
c = c + 1
End If
If c = 60 Then
c = 0
b = b + 1
End If
If b = 60 Then
b = 0
a = a + 1
End If
End Sub
سوال دوم هم که فعلا نمیدونم ولی شاید بتونم واستون درست کنم !
----
راستی مطمئنید بدون Timer هم میشه درستش کرد ؟ اگه آره ... بگو ، شاید ما هم کمی فک کردیم تونستیم درستش کنیم !
من خودم یک برنامه دیدم که با وی بی نوشته شده بود و با دقت میلی ثانیه حساب می کرد. ولی مطمئنم با تایمر نبود چون باتایمر دقیق نمی شه.
Api Timer + Array WithEvents
This code contains 2 classes, One is a base API timer class that can be used as a standalone timer replacement (does not need a form to host timer) The second, is a class that holds an array of these timer objects and allows you handle events of a timer array just like the default VB timer object. VB Does not have built in support for handling an array of objects withevents. So this shows you how to code it yourself.
کد:http://www.planet-source-code.com/vb/scripts/ShowZip.asp?lngWId=1&lngCodeId=49263&strZipAccessCode=tp%2FA492637101