Lanjutan dari Postingan kemarin, sekarang kita akan membuat sebuah label yang Captionnya bisa berkedip berubah warnanya.
OK kita lansung saja step by stepnya :
- Buat Project Baru standard Exe.
- Kita tambahkan 1 label dan 1 timer.
- Setelah itu Copy Script berikut ke dalam project anda.
- Nah kita Run, dan lihat hasilnya!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Teks Kedip | |
'By Mr. Nugh | |
'2015 | |
'Esaprasetio.blogspot.com | |
'Skybynez.wordpress.com | |
Dim i As Long 'Deklarasi | |
Dim merah, hijau, biru As Integer 'Variabel global | |
Private Sub Form_Load() | |
i = 0 'Inisialisasi detik | |
Timer1.Interval = 100 'Kalau 1000 biasanya lompat 1 detik | |
End Sub | |
Private Sub Timer1_Timer() | |
i = i + 1 | |
If i = 1000000 Then i = 0 'Supaya tdk overflow, dsb... | |
merah = Int(255 * Rnd) 'Bangkitkan angka random untuk merah | |
hijau = Int(255 * Rnd) 'Bangkitkan angka random untuk hijau | |
biru = Int(255 * Rnd) 'Bangkitkan angka random untuk biru | |
LblKedip.ForeColor = RGB(merah, hijau, biru) 'Campur tiga warna | |
If i Mod 2 = 0 Then 'Jika counter habis dibagi 2 | |
LblKedip.Visible = True 'Tampilkan label | |
Else 'Jika counter tidak habis dibagi 2 | |
LblKedip.Visible = False 'Sembunyikan label | |
End If 'Akhir pemeriksaan | |
End Sub | |
'Akhir Program - - >> |
Demikian Tutorialnya
Semoga Bermanfaat
Google + : https://plus.google.com/u/0/+esaprasetio
Twitter : http://twitter.com/aphriell_art
IG : @aphriel_art
Blog :
aprilartwork.blogspot.com for my artwork
aphriellart.blogspot.com for some tutorial
Email : aphriellart@gmail.com
Google + : https://plus.google.com/u/0/+esaprasetio
Twitter : http://twitter.com/aphriell_art
IG : @aphriel_art
Blog :
aprilartwork.blogspot.com for my artwork
aphriellart.blogspot.com for some tutorial
Email : aphriellart@gmail.com