Setelah kita melihat teladan aplikasi aktivitas penerimaan siswa gres sekolah mengemudi memakai visual basic 6.0, selanjutnya kita akan menciptakan form Menu.
Langkah-langkah :
1. Buat form menu, Pilih Project (menu kafe atas) dan pilih MDI form.
2. Selanjutnya silahkan buat hidangan menyerupai dibawah ini :
Jika gundah membuatnya, silahkan baca tutorial menciptakan hidangan pada visual basic
3. Beri name pada masing-masing caption hidangan dan sub menu
- File
- login (name=mloginuser)
- ganti password (name=mganti)
- logout (name=mlogout)
- exit (name=mexit)
- Master Data (name=mdata)
- Master data user (name=mdatauser)
- Master data Siswa (name=mdatasiswa)
- Master data Mobil (name=mdatamobil)
- Master data Biaya (name=mdatabiaya)
- Master data Jam latihan (name=mdatajam)
- Transaksi (name=mtransaksi)
- Pendaftaran (name=mpendaftaran)
- Pembuatan SIM A (name=mbuatsima)
- Jadwal (name=mjadwal)
- Laporan (name=mlaporan)
- Riwayat Login (name=mriwayat)
-Info (name=minfo)
4. Pastekan Koding dibawah ini pada source code
Private Sub mbuatsima_Click()
Call nonaktifsementara
fbuatsim.Show
End Sub
Private Sub mdatabiaya_Click()
Call nonaktifsementara
fbiaya.Show
End Sub
Private Sub mdatasiswa_Click()
fsiswa.Show
Call nonaktifsementara
End Sub
Private Sub mdatauser_Click()
Call nonaktifsementara
fuser.Show
End Sub
Sub aktifuser()
fmenu.mganti.Enabled = True
fmenu.mdata.Enabled = True
fmenu.mdatabiaya.Enabled = False
fmenu.mdatauser.Enabled = False
fmenu.mdatasiswa.Enabled = True
fmenu.mjadwal.Enabled = True
fmenu.mtransaksi.Enabled = True
fmenu.mlaporan.Enabled = True
fmenu.mlogout.Enabled = True
fmenu.mloguser.Enabled = False
fmenu.mmobil.Enabled = False
fmenu.mjam.Enabled = False
End Sub
Private Sub MDIForm_Load()
Call nonaktif
End Sub
Private Sub mexit_Click()
a = MsgBox("Yakin Keluar Program?", vbCritical + vbYesNo, "INFO")
If a = vbYes Then
End
End If
End Sub
Private Sub mganti_Click()
Call nonaktifsementara
fgantipassword.Show
End Sub
Private Sub minfo_Click()
MsgBox "Selamat Datang di aplikasi penerimaan siswa gres sekolah mengemudi Tunas Bangsa Karawang, jikalau ada problem mengenai aplikasi ini Hub : 085711001775", vbInformation, "INFO"
End Sub
Private Sub mjadwal_Click()
Call nonaktifsementara
fjadwal.Show
End Sub
Private Sub mjam_Click()
fjamlatihan.Show
Call nonaktifsementara
End Sub
Private Sub mlaporan_Click()
Call nonaktifsementara
flaporan.Show
End Sub
Sub nonaktif()
mdata.Enabled = False
mtransaksi.Enabled = False
mjadwal.Enabled = False
mlaporan.Enabled = False
mlogout.Enabled = False
mriwayat.Enabled = False
mganti.Enabled = False
mmobil.Enabled = False
fmenu.StatusBar.Panels(2) = "---"
fmenu.StatusBar.Panels(4) = "---"
fmenu.StatusBar.Panels(6) = "---"
End Sub
Sub nonaktifsementara()
mlog.Enabled = False
minfo.Enabled = False
mdata.Enabled = False
mtransaksi.Enabled = False
mjadwal.Enabled = False
mlaporan.Enabled = False
mlogout.Enabled = False
mriwayat.Enabled = False
mganti.Enabled = False
mmobil.Enabled = False
End Sub
Private Sub mlogadmin_Click()
floginadmin.Show
End Sub
Private Sub mlogout_Click()
a = MsgBox("Yakin Logout?", vbCritical + vbYesNo, "INFO")
If a = vbYes Then
Call koneksi
Call nonaktif
mloguser.Enabled = True
End If
End Sub
Private Sub mloguser_Click()
floginuser.Show
End Sub
Private Sub mmobil_Click()
Call nonaktifsementara
fmobil.Show
End Sub
Private Sub mpendaftaran_Click()
Call nonaktifsementara
fpendaftaran.Show
End Sub
Private Sub mriwayat_Click()
Call nonaktifsementara
friwayat.Show
End Sub
Private Sub Timer1_Timer()
fmenu.StatusBar.Panels(8) = Time
fmenu.StatusBar.Panels(10) = Format(Date, "yyyy-m-d")
End Sub
Call nonaktifsementara
fbuatsim.Show
End Sub
Private Sub mdatabiaya_Click()
Call nonaktifsementara
fbiaya.Show
End Sub
Private Sub mdatasiswa_Click()
fsiswa.Show
Call nonaktifsementara
End Sub
Private Sub mdatauser_Click()
Call nonaktifsementara
fuser.Show
End Sub
Sub aktifuser()
fmenu.mganti.Enabled = True
fmenu.mdata.Enabled = True
fmenu.mdatabiaya.Enabled = False
fmenu.mdatauser.Enabled = False
fmenu.mdatasiswa.Enabled = True
fmenu.mjadwal.Enabled = True
fmenu.mtransaksi.Enabled = True
fmenu.mlaporan.Enabled = True
fmenu.mlogout.Enabled = True
fmenu.mloguser.Enabled = False
fmenu.mmobil.Enabled = False
fmenu.mjam.Enabled = False
End Sub
Private Sub MDIForm_Load()
Call nonaktif
End Sub
Private Sub mexit_Click()
a = MsgBox("Yakin Keluar Program?", vbCritical + vbYesNo, "INFO")
If a = vbYes Then
End
End If
End Sub
Private Sub mganti_Click()
Call nonaktifsementara
fgantipassword.Show
End Sub
Private Sub minfo_Click()
MsgBox "Selamat Datang di aplikasi penerimaan siswa gres sekolah mengemudi Tunas Bangsa Karawang, jikalau ada problem mengenai aplikasi ini Hub : 085711001775", vbInformation, "INFO"
End Sub
Private Sub mjadwal_Click()
Call nonaktifsementara
fjadwal.Show
End Sub
Private Sub mjam_Click()
fjamlatihan.Show
Call nonaktifsementara
End Sub
Private Sub mlaporan_Click()
Call nonaktifsementara
flaporan.Show
End Sub
Sub nonaktif()
mdata.Enabled = False
mtransaksi.Enabled = False
mjadwal.Enabled = False
mlaporan.Enabled = False
mlogout.Enabled = False
mriwayat.Enabled = False
mganti.Enabled = False
mmobil.Enabled = False
fmenu.StatusBar.Panels(2) = "---"
fmenu.StatusBar.Panels(4) = "---"
fmenu.StatusBar.Panels(6) = "---"
End Sub
Sub nonaktifsementara()
mlog.Enabled = False
minfo.Enabled = False
mdata.Enabled = False
mtransaksi.Enabled = False
mjadwal.Enabled = False
mlaporan.Enabled = False
mlogout.Enabled = False
mriwayat.Enabled = False
mganti.Enabled = False
mmobil.Enabled = False
End Sub
Private Sub mlogadmin_Click()
floginadmin.Show
End Sub
Private Sub mlogout_Click()
a = MsgBox("Yakin Logout?", vbCritical + vbYesNo, "INFO")
If a = vbYes Then
Call koneksi
Call nonaktif
mloguser.Enabled = True
End If
End Sub
Private Sub mloguser_Click()
floginuser.Show
End Sub
Private Sub mmobil_Click()
Call nonaktifsementara
fmobil.Show
End Sub
Private Sub mpendaftaran_Click()
Call nonaktifsementara
fpendaftaran.Show
End Sub
Private Sub mriwayat_Click()
Call nonaktifsementara
friwayat.Show
End Sub
Private Sub Timer1_Timer()
fmenu.StatusBar.Panels(8) = Time
fmenu.StatusBar.Panels(10) = Format(Date, "yyyy-m-d")
End Sub
Sumber http://www.hendrisetiawan.com