Masukkan Code berikut ini
Public Class Form1
‘—mengisi tindakan pada object Form dengan metode Load
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
‘—mengisi properti pada object Form
Me.Text = “Latihan Menampilkan dan Menghapus Data”
Me.ControlBox = False
Me.BackColor = Color.PeachPuff
Me.StartPosition = FormStartPosition.CenterScreen
‘—mengisi properti pada object Label
Me.LbNim.Text = “No. Induk Mahasiswa”
Me.LbNama.Text = “Nama Lengkap”
Me.LbKelamin.Text = “Jenis Kelamin”
Me.LbAlamat.Text = “Alamat Lengkap”
Me.LbKota.Text = “K o t a”
‘—mengisi tindakan pada objek Button
Me.BtList.Text = “&List”
Me.BtClear.Text = “&Clear”
Me.BtExit.Text = “&Exit”
End Sub
‘—mengisi tindakan pada objek Button list dengan metode Click
Private Sub BtList_Click(sender As System.Object, e As System.EventArgs) Handles BtList.Click
Me.TxtNim.Text = “2011-001″
Me.TxtNama.Text = “Anak Rantau”
Me.TxtKelamin.Text = “Laki-laki”
Me.TxtAlamat.Text = “Jatirasa Barat, Karang Pawitan”
Me.TxtKota.Text = “Karawang”
End Sub
‘—mengisi tindakan pada objek Button Clear
Private Sub BtClear_Click(sender As System.Object, e As System.EventArgs) Handles BtClear.Click
Me.TxtNim.Clear()
Me.TxtNama.Clear()
Me.TxtKelamin.Clear()
Me.TxtAlamat.Clear()
Me.TxtKota.Clear()
Me.TxtNim.Focus()
End Sub
‘—mengisi tindakan pada button Exit
Private Sub BtExit_Click(sender As System.Object, e As System.EventArgs) Handles BtExit.Click
Me.Close()
End Sub
End Class
Save dan coba di loading.., akan tampil seperti ini
selamat mencoba.
Atau download program disini.
Source : http://ekosuhartono.blogdetik.com/
No comments:
Post a Comment