Pembuatan Form Utama dan Alurnya
Setelah kita melakukan perencanaan dan perancangan sistem,
maka sekarang kita meracang aplikasi yang akan kita pakai dalam sistem
informasi penjualan ini. Pertama kita akan membuat form tampilan awal. Tampilan
awal aplikasi berperan penting dalam aplikasi karena di sini adalah daya tarik
pertama kali user dalam menilai suatu aplikasi. Kalau tampilan utama dari
aplikasi saja sudah tidak menarik maka user juga akan enggan dalam menggunakan
aplikasi ini. Oleh karena itu kita harus menata tampilan awal aplikasi
semenarik mungkin. Tidak perlu banyak tampilan atau animasi karena akan memakan
memori yang besar.
Yang
harus dipersiapkan dalam pembuatan form utama kali adalah
Object
|
Properties
|
Setting
|
Form
|
Name
|
FrmUtama
|
BackColor
|
&H00F0F0F0&
|
|
BorderStyle
|
0-None
|
|
StartUpPosition
|
2-CenterScreen
|
|
WindowState
|
2-Maxizimed
|
|
Image
|
Name
|
Image1
|
Stretch
|
True
|
|
SmartMenuXP
|
Name
|
SmartMenuXP1
|
Label
|
Name
|
Label1
|
Font
|
Calibri
|
|
ForeColor
|
&H00FF0000&
|
|
Name
|
Label2
|
|
Font
|
Calibri
|
|
ForeColor
|
&H00FF0000&
|
Untuk
membuatnya seperti ini maka harus di beri coding sebagai berikut :
Dim Aa As Integer
Private Sub Command1_Click()
Aa = Aa + 1
SmartMenuXP1.BorderStyle = mxpBump
End Sub
Private Sub Form_Activate()
Dim Status1 As String
If Connect1 Then
Status1 =
"Connected"
Else: Status1 = "Disconnect"
End If
Me.BackColor = &HDCB291
Image1.Top = Me.Top + 700
Image1.Left = Me.Left + 100
Image1.Width = Me.Width - 200
Image1.Height = Me.Height - 900
Label3.Caption = "User : " & User.UserId
Label1.Caption = "Database : " & Status1
Label3.Left = Me.Left + Me.Width - 3000
Label1.Left = Me.Left + Me.Width - 3000
End Sub
Private Function getIcon(ByVal iconName As String) As
StdPicture
Set getIcon = LoadPicture(App.Path
+ "\Icons\" + iconName + ".ico")
End Function
Private Sub Form_KeyDown(KeyCode As Integer, Shift As
Integer)
If KeyCode = 27 Then
If
MsgBox("Akan Keluar Program?", vbYesNo + vbCritical,
"Quit") = vbYes Then
Unload
FrmUtama
End If
End If
End Sub
Private Sub Form_Load()
Connect1 = False
Connect2 = False
Aa = 1
With SmartMenuXP1.MenuItems
.Add 0,
"mnuServer", , "&Server
"
.Add
"mnuServer", "mnuLogin", , "Log&in",
getIcon("Login")
.Add
"mnuServer", "mnuLogout", , "&Log&out",
getIcon("Exit")
.Add
"mnuServer", , smiSeparator
.Add
"mnuServer", "mnuExit", , "&Exit"
'TODO :
DEFINISI MENU YANG LAIN
.Add 0,
"mnuData", , "&Data
"
.Add
"mnuData", "mnuSupplier", , "&Supplier",
getIcon("Supplier")
.Add
"mnuData", "mnuKonsumen", , "&Konsumen",
getIcon("Konsumen")
.Add
"mnuData", "mnuSales", , "Sa&les",
getIcon("Sales")
.Add
"mnuData", , smiSeparator
.Add
"mnuData", "mnuJenis", , "&Jenis"
.Add
"mnuData", "mnuSatuan", , "Sa&tuan"
.Add
"mnuData", , smiSeparator
.Add
"mnuData", "mnuBarang", , "&Barang",
getIcon("Barang")
.Add
"mnuData", , smiSeparator
.Add
"mnuData", "mnuMutasi", , "&Mutasi Barang", getIcon("Mutasi")
.Add 0,
"mnuTransaksi", , "&Transaksi "
.Add
"mnuTransaksi", "mnuGrosir", , "Penjualan
&Grosir", getIcon("Grosir")
.Add
"mnuTransaksi", "mnuEceran", , "Penjualan
&Eceran", getIcon("Eceran")
.Add "mnuTransaksi",
"mnuReturJual", , "&Retur Penjualan",
getIcon("Retur Jual")
.Add
"mnuTransaksi", , smiSeparator
.Add
"mnuTransaksi", "mnuPembelian", ,
"&Pembelian", getIcon("Pembelian")
.Add
"mnuTransaksi", "mnuReturBeli", , "Retur Pem&belian",
getIcon("Retur Beli")
.Add 0,
"mnuAbout", , "&About
", getIcon("Me")
End With
End Sub
Private Sub SmartMenuXP1_Click(ByVal ID As Long)
With SmartMenuXP1.MenuItems
Select Case
.Key(ID)
Case
"mnuLogin":
If Not
Connect1 Then
With FrmLoginServer
.Show , FrmUtama
End With
Else
FrmLogin.Show , FrmUtama
End If
Case
"mnuLogout": Connect2 = False
Case
"mnuClose": Unload Me
Case
"mnuBarang": CekKonek FrmDataBarang
Case
"mnuAbout": FrmAbout.Show , FrmUtama
Case
"mnuJenis": CekKonek FrmJenisBarang
Case
"mnuPrint": 'TODO : something here
Case
"mnuMailRecipient": 'TODO : something here
Case
"mnuMailRecipientReview": 'TODO : something here
Case
"mnuOnlineMeetingParticipant": 'TODO : something here
Case
"mnuFaxRecipient": 'TODO : something here
Case
"mnuMicrosoftPowerPoint": 'TODO : something here
Case
"mnuExit": End
End Select
End With
End Sub
Comments
Post a Comment