15.1.12

Create Auto Copy With VB6

Halo, ane mw share lagi tentang VB6 yah ? !
mungkin ada yang belum tw maksudnya auto copy , nih download contohnya dulu : Contoh Copy
Cara menggunakan :
. Tulis di textboxnya,
. Pencet copy, dan wala, tulisan di textbox telah tercopy secara otomatis.. !

Tutorial membuatnya :
. Buat 1 buah CommandButton, 1 buat TextBox
. Ganti name CommandButton menjadi : cmdCopy
. Ganti name TexBox menjadi : txtTarget
. Hapus tex di texbox
. isikan kode berikut di form :

Private Sub cdmCopy_Click()
    Clipboard.SetText txtTarget.Text
    MsgBox "Text Telah berhasil disalinkan pada clipboard. =)", vbInformation, "UHD"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
OpenURL "http://www.uhdcode.blogspot.com", Me.hWnd
End Sub
. kalo sudah add module , ganti nama module menjadi :  ModUHD . lalu masukin kode sebagai berikut :
'modul UHD
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
                (ByVal hwnd As Long, _
                ByVal lpOperation As String, _
                ByVal lpFile As String, _
                ByVal lpParameters As String, _
                ByVal lpDirectory As String, _
                ByVal nShowCmd As Long) As Long
Public Sub OpenURL(situs As String, sourceHWND As Long)
     Call ShellExecute(sourceHWND, vbNullString, situs, vbNullString, vbNullString, 1)
End Sub
. Tinggal di hias deh,

Silahkan Menikmati =)

No comments:

Post a Comment