Kayıt
17 Kasım 2007
Mesajlar
10.379
Beğeniler
2
Şehir
istanbul / bomonti
Arkadaşlar örnek bir ışıklandırma işlemi. Gerçi bu işlem gerçekte sayıcılarla yapılıyor olsada minyatür bir lamba diyebiliriz. :wink1:
'2 tane label
'1 tane timer
'3 tane shape ekleyin ve kodları yapıştırın.:wink1:

Kod:
Private Sub Form_Load()
Label2.Caption = ""
Timer1.Interval = 1000
Form1.Height = 3255
Form1.Width = 2025
Form1.BorderStyle = 5
Shape1.BackStyle = 1
Shape2.BackStyle = 1
Shape3.BackStyle = 1
Shape1.BackColor = &H80&
Shape2.BackColor = &HC0C0&
Shape3.BackColor = &H8000&
Shape1.Top = 720
Shape1.Left = 280
Shape2.Top = 1440
Shape2.Left = 280
Shape3.Top = 2160
Shape3.Left = 280
Form1.Caption = "[email protected]"
Shape1.Shape = 3
Shape2.Shape = 3
Shape3.Shape = 3
Label1.Top = 1200
Label1.Left = 3600
Label2.FontSize = 22
Label2.FontBold = True
Label2.Top = 120
Label2.Left = 240
Label2.Alignment = 2
End Sub

Private Sub Label1_Change()
If Label1 < 33 Then
Shape3.BackColor = &H8000&
Shape1.BackColor = &HFF&
Label2.Caption = 33 - Label1
End If
If Label1 = 33 Then
Shape1.BackColor = &H80&
Shape2.BackColor = &H80FFFF
Label2.Caption = 34 - Label1
End If
If Label1 > 34 Then
Shape2.BackColor = &HC0C0&
Shape3.BackColor = &HFF00&
Label2.Caption = 60 - Label1
End If
End Sub

Private Sub Timer1_Timer()
Label1 = Second(Time)
End Sub
 
Yukarı Alt