<< Kembali

Efek menghapus

 
Nama Control Properti Value
TextBox Name
Teks
txtHasil
-
Module Name Module1
CommandButton Name cmdHapus
 

 Copy & paste-kan listing dibawah ini ke Form pada code editor :

 Option Explicit

Public Sub MatrixClear()
Dim I As Integer
I = Len(txtHasil.Text) 'Tentukan I = jumlah karakter yg dibentuk

Do
DoEvents

Delay 100
Beep 'Suara beep bios

'I dikurang 2
'2 disini adalah banyak karakter yg dihapus perdetik

I = I - 2

'Jika I < 2 maka penghapusan sudah tidak
'dapat dilakukan lagi maka

If I < 2 Then
'Hapus semua
txtHasil.Text = ""
'Keluar perulangan
Exit Do
End If

'Tampilkan teks yg tersisa
txtHasil.Text = Left(txtHasil.Text, I)

Loop Until I < 1

txtHasil.Text = ""
End Sub

Private Sub cmdHapus_Click()
MatrixClear
End Sub


 Buatlah module lalu copy & paste-kan listing dibawah ini ke dalam module :

Option Explicit

Declare Function GetTickCount Lib "kernel32" () As Long

'Fungsi ini menggantikan Timer control
Public Function Delay(wait As Long)
Dim lasttick, currenttick As Long
lasttick = GetTickCount
Do
currenttick = GetTickCount
DoEvents
Loop Until (currenttick - lasttick) > wait
End Function


<< Kembali
Hosted by www.Geocities.ws

1