|
-
Oct 16th, 2002, 01:57 PM
#1
Thread Starter
Hyperactive Member
Time?
How do i add a clock, digital or analog, analog better to my app?
It is not a directx app.
thankyou
-
Oct 16th, 2002, 02:04 PM
#2
Banned
Add a timer to your form with interval set to 1000 and a label.
then use this code for the timer:
VB Code:
Private Sub Timer1_Timer()
Label1.Caption = Time
End Sub
-
Oct 16th, 2002, 02:07 PM
#3
Banned
Ow, I misread your post. You prefer analog above digital 
Well, then you must draw a line and use a timer to change one of its coordinates all the time to make it turn in a circle.
-
Oct 16th, 2002, 02:21 PM
#4
Thread Starter
Hyperactive Member
Ok i have done what you said and the label just days True.
I am doing the digital one.
thanks.
-
Oct 16th, 2002, 02:22 PM
#5
Banned
Originally posted by Chrome
Ok i have done what you said and the label just days True.
I am doing the digital one.
thanks.
The label says true??? Could you post your code?
Oh, and as I stated above, the code I posted, give you an digital clock.
-
Oct 16th, 2002, 02:23 PM
#6
Hyperactive Member
I know how to do the analog one if you want.
53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.

-
Oct 16th, 2002, 02:25 PM
#7
Thread Starter
Hyperactive Member
Ok here.
Private Sub Time_Timer()
lblTime.Caption = Time
End Sub
-
Oct 16th, 2002, 02:27 PM
#8
Hyperactive Member
Originally posted by Chrome
Ok here.
Private Sub Time_Timer()
lblTime.Caption = Time
End Sub
What you mean?
53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.

-
Oct 16th, 2002, 02:29 PM
#9
Thread Starter
Hyperactive Member
i dunno i jus wrote wat mike said 2 put.
Private Sub Time_Timer() <--------- is my timer
lblTime.Caption = Time <--------- is where i want time to display
End Sub
-
Oct 16th, 2002, 02:34 PM
#10
Hyperactive Member
I thought you wanted Analog. I can give you the code for it.
Analog:
._._.
. \_.
._._.
Digital:
_ _
|_|*| | |
|_|*|_| |
Which one did you want in the first place?
53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.

-
Oct 16th, 2002, 02:35 PM
#11
Hyperactive Member
53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.

-
Oct 16th, 2002, 02:37 PM
#12
Thread Starter
Hyperactive Member
ok, no i wanted analog, but thought digi was easier, but if u can help me wiv analog then it much much MUCH appreciated.
thanks.
-
Oct 16th, 2002, 02:43 PM
#13
Put a picture box on your form, and a timer with interval of 1000
Leave default names
VB Code:
Public Sub ShowAnalogTime(ByVal MyTime As Date, Pic As PictureBox)
Dim H As Single, M As Single, S As Single
Const HPI As Double = 1.5707963267949 ' (4 * Atn(1)) / 2
Const PI2 As Double = 6.28318530717959 ' (4 * Atn(1)) * 2
H = (Hour(MyTime) Mod 12) / 12#
M = Minute(MyTime) / 60#
S = Second(MyTime) / 60#
Pic.Scale (-1.1, -1.1)-(1.1, 1.1)
Pic.DrawWidth = 2
Pic.Cls
Pic.Circle (0, 0), 1, RGB(128, 128, 128)
Pic.Line (0, 0)-(0.5 * Cos(PI2 * H - HPI), 0.5 * Sin(PI2 * H - HPI)), RGB(0, 0, 128)
Pic.Line (0, 0)-(0.8 * Cos(PI2 * M - HPI), 0.8 * Sin(PI2 * M - HPI)), RGB(128, 128, 255)
Pic.Line (0, 0)-(Cos(PI2 * S - HPI), Sin(PI2 * S - HPI)), RGB(255, 255, 255)
End Sub
Private Sub Timer1_Timer()
ShowAnalogTime Time, Picture1
End Sub
-
Oct 16th, 2002, 02:45 PM
#14
Banned
Alright!
Whow, that's pretty cool!
-
Oct 16th, 2002, 02:46 PM
#15
-
Oct 16th, 2002, 02:49 PM
#16
Thread Starter
Hyperactive Member
-
Oct 16th, 2002, 02:51 PM
#17
PS, the picture must be perfect square, otherwise it won't show the circle properly...
-
Oct 16th, 2002, 02:54 PM
#18
Originally posted by Q_Me
 Damn dude, My analog code was simpler than that.
If your analog code is simpler than mine, then why don't you post it ?
-
Oct 16th, 2002, 02:55 PM
#19
Banned

Don't fight boys......
-
Oct 16th, 2002, 09:06 PM
#20
Fanatic Member
Re: Time?
Originally posted by Chrome
How do i add a clock, digital or analog, analog better to my app?
For a simple digital, you can use statusbar control with a panel set to time style.
-
Oct 16th, 2002, 09:20 PM
#21
The picture isn't missing
the digital one returned True because your timer name is also Time.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Oct 17th, 2002, 10:15 AM
#22
Hyperactive Member
Originally posted by CVMichael
If your analog code is simpler than mine, then why don't you post it ?
I think he's better off with yours, mine needs like a page in a module for all the information. But with mine, you can customly make it. But I dont think he want's a fancy one.
53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.

-
Oct 17th, 2002, 10:27 AM
#23
Thread Starter
Hyperactive Member
Na guys i'm all right now, and now i see bugger, oops. lol.
Thanks all of you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|