Forum Informatika
Silahkan Login

Kami sarankan anda register atau daftar terlebih dahulu agar anda dapat mendownload atau membuka category forum secara keseluruhan....
karena ada beberapa forum yang tertutup untuk tamu dan dengan Login Anda bisa menggunakan fasilitas Chatting yang kami miliki.

Selamat Bergabung

Forum Informatika

Created By Hanafi Sukawa Ginting
 
HomeFAQPasang Iklanfacebook InformatikaRegisterLog inNew Tab Newscomputer

Share | 
 

 Aplikasi Jam Analog Dengan VB6

View previous topic View next topic Go down 
AuthorMessage


Change Your Avatar -------------->


admin

Admin
Rank : Admin


My Pets :
Jumlah posting : 550
Point : 2147483647
Reputasi : 47
Join date : 2010-04-23
Age : 24
Lokasi : indonesia

PostSubject: Aplikasi Jam Analog Dengan VB6   Wed 27 Oct 2010, 09:00



Code:
'Analog Clock By Shahab Harrafi
'Email: [You must be registered and logged in to see this link.]

Option Explicit

Private Const pi As Double = 3.14159265358979

Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long


Private Sub MakeRoundObject(objObject As Object, Value As Long)
    Static lngHeight, lngLong, lngReturn, lngWidth As Long
   
    lngWidth = objObject.Width / Screen.TwipsPerPixelX
    lngHeight = objObject.Height / Screen.TwipsPerPixelY
                 
    SetWindowRgn objObject.hWnd, CreateRoundRectRgn(0, 0, lngWidth, lngHeight, Value, Value), True
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyEscape Then
        App.TaskVisible = False
        Unload Me
        End
    End If
End Sub

Private Sub Form_Load()
    Dim intX As Integer
   
    Call MakeRoundObject(frmMain, 20)
    Call tmrClock_Timer
   
    For intX = 0 To 360 Step 6
        If intX Mod 30 = 0 Then
            Me.DrawWidth = 6
            Me.PSet (1100 * Cos(intX * pi / 180) + lineSecond.X1, 1100 * Sin(intX * pi / 180) + lineSecond.Y1)
        Else
            Me.DrawWidth = 3
            Me.PSet (1100 * Cos(intX * pi / 180) + lineSecond.X1, 1100 * Sin(intX * pi / 180) + lineSecond.Y1)
        End If
    Next intX
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ReleaseCapture
    SendMessage Me.hWnd, &HA1, 2, 0&
End Sub

Private Sub lblTime_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Form_MouseDown(Button, Shift, X, Y)
End Sub

Private Sub tmrClock_Timer()
    Dim dblSecond As Double, dblMinute As Double, dblHour As Double
   
    dblSecond = Second(Now) * 6 - 90
    dblMinute = (Minute(Now) + Second(Now) / 60) * 6 - 90
    dblHour = (Hour(Now) + Minute(Now) / 60) * 30 - 90

    lineSecond.X2 = 1000 * Cos(dblSecond * pi / 180) + lineSecond.X1
    lineSecond.Y2 = 1000 * Sin(dblSecond * pi / 180) + lineSecond.Y1
    lineMinute.X2 = 900 * Cos(dblMinute * pi / 180) + lineMinute.X1
    lineMinute.Y2 = 900 * Sin(dblMinute * pi / 180) + lineMinute.Y1
    lineHour.X2 = 700 * Cos(dblHour * pi / 180) + lineHour.X1
    lineHour.Y2 = 700 * Sin(dblHour * pi / 180) + lineHour.Y1
   
    lblTime.Caption = Format(Now, "hh:mm:ss AM/PM")
End Sub



Download Di Link DI bawah !!!

Link Download
Back to top Go down
http://software-download1001.blogspot.com/
 

Aplikasi Jam Analog Dengan VB6

View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Forum Informatika ::  :: VB6-
Jump to:  

Free forum | © phpBB | Free forum support | Contact | Report an abuse | Free forum