Step 1 : Buka Program VB 6
kemudian Masukan Komponen SmartMenuXP seperti pada gambar 1 dan 2
Gambar 1
Gambar 2
Step 2 : Checklist
komponen SmartMenuXP dalam Form
Gambar 3
Step 3 : Buat
Class Module
Gambar 4
Ketikan Kode Program di
Class Module seperti pada gambar 5 :
Gambar 5
Source Code Class Module :
Dim clsmn As clsmn
Public Sub BuatMenu(SMXP1 As Object, strPath As String)
With SMXP1.MenuItems
'MENU ADMINISTRATOR
.Add 0,
"mnadmin", , "Administrator"
.Add "mnadmin",
"mnganti", , "Ganti Password"
.Add "mnadmin",
, smiSeparator
.Add "mnadmin",
"mnmanajemen", , "Manajemen User"
.Add "mnadmin",
, smiSeparator
.Add "mnadmin",
"mnuser", , "Data User"
.Add "mnadmin",
, smiSeparator
'MENU AKUNTANSI
.Add 0,
"mnakun", , "Akuntansi Dan Pajak"
.Add "mnakun",
"mnchart", , "Chart Of Account"
.Add "mnakun",
, smiSeparator
.Add "mnakun",
"mnbank", , "Daftar Bank"
.Add "mnakun",
, smiSeparator
.Add "mnakun",
"mnjurnal", , "Jurnal"
.Add "mnakun",
, smiSeparator
.Add "mnakun",
"mnlaba", , "Laba Rugi"
.Add "mnakun",
, smiSeparator
.Add "mnakun",
"mnneraca", , "Neraca"
.Add "mnakun",
, smiSeparator
.Add "mnakun",
"mntrans", , "Transfer Dan Dropping"
.Add "mnakun",
, smiSeparator
.Add "mnakun",
"mnbukbes", , "Buku Besar"
.Add "mnakun",
, smiSeparator
'MENU Payroll HRD
.Add 0,
"mnphrd", , "HRD"
.Add "mnphrd",
"mndep", , "Data Departemen"
.Add "mnphrd",
, smiSeparator
.Add "mnphrd",
"mnjab", , "Data Jabatan"
.Add "mnphrd",
, smiSeparator
.Add "mnphrd",
"mngol", , "Data Golongan"
.Add "mnphrd",
, smiSeparator
.Add "mnphrd",
"mnpeg", , "Data Pegawai"
.Add "mnphrd",
, smiSeparator
.Add "mnphrd",
"mnkeluarga", , "Data Keluraga Pegawai"
'MENU Logistik dan Umum
.Add 0,
"mnlogumum", , "Logistik Dan Umum"
.Add
"mnlogumum", "mnlog", , "Data Logistik"
.Add
"mnlogumum", , smiSeparator
'MENU KELUAR
.Add 0, "mnexit",
, "Keluar"
.Add "mnexit",
"mnkeluar", , "Keluar Dari Program"
End With
SMXP1.Font.Name = "Ms
Sans Serif"
SMXP1.Font.Size = 9
End Sub
Ketikan Kode Program
di MainForm seperti pada gambar 6 :
Gambar 6
Source Code
MainForm :
Private Function getIcon(ByVal iconName
As String) As StdPicture
Set getIcon = LoadPicture(App.Path + "\Icons\" + iconName +
".ico")
End Function
Private Sub Form_Load()
Set clsmn = New clsmn
Call clsmn.BuatMenu(SMXP1, App.Path)
Set clsmn = Nothing
End Sub
Private Sub SMXP1_Click(ByVal ID As
Long)
With SMXP1.MenuItems
Select Case .Key(ID)
'MENU MASTER
Case "mneditpass"
editpass.Show
Case "mnmanaj"
setmenu.Show
Case "mnuser"
user.Show
'MENU AKUNTANSI
Case "mnchart"
perkiraan.Show
Case "mnbank"
Bank.Show
Case "mnjurnal"
Jurnal.Show
Case "mnlaba"
LabaRugi.Show
Case "mnneraca"
Neraca.Show
Case "mnTrans"
TransferDrop.Show
Case "mnbukbes"
Bukubesar.Show
'MENU HRD
Case "mndep"
departemen.Show
Case "mnjab"
jabatan.Show
Case "mngol"
golongan.Show
Case "mnpeg"
pegawai.Show
'MENU Logistik & Umum
Case "mnlog"
Logistik.Show
'MENU KELUAR
Case "mnkeluar"
If MsgBox("Anda ingin
keluar dari Aplikasi ?", vbQuestion + vbYesNo, "Konfirmasi") = vbYes
Then
End
End If
End Select
End With
End Sub
Private Sub mnkeluar_Click()
Unload MainForm
End Sub
Tampilan Main Form dengan SmartMenuXP
Catatan : Ubahlah
menu sesuai Fitur atau Content yang anda buat Contoh diatas hanya sebagai
gambaran.