Friday, 5 June 2015

Membuat Menu Utama Pada VB. Net

Aplikasi Penjualan Buku Menggunakan Vb. Net dan Access

Step 5 : Membuat Menu Utama

Tambah kan sebuah form(Langkah-langkahnya seperti pada Step2: Membuat Form Data Buku) Rename Form1.vb menjadi MenuUtama.vb lalu rancang lah MenuUtama.vb seperti gambar dibawah ini :


Klik Tab ToolBox > drag MenuStrip, 4 (Empat) Button dan 5 (Lima) GroupBox kedalam Form Laporan. Atur desain menu utama seperti gambar berikut :


Ketikan koding pada masing-masing object seperti kode berikut :

Public Class MenuUtama

    Private Sub KodeBukuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KodeBarangToolStripMenuItem.Click
        FormKode.Show()
    End Sub

    Private Sub DataBukuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JenisBarangToolStripMenuItem.Click
        FormData.Show()
    End Sub

    Private Sub TransaksiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TransaksiToolStripMenuItem.Click
        FormTransaksi.Show()
    End Sub

    Private Sub LaporanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanToolStripMenuItem.Click
        Laporan.Show()
    End Sub

    Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click
        If MessageBox.Show("Keluar Dari Aplikasi..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
            End
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        FormData.Show()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        FormTransaksi.Show()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Laporan.Show()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.Close()
    End Sub

End Class

Tutorial bisa didownload Disini

0 komentar:

Post a Comment

Kunjungan Sobat

Popular Posts

Enter your email address:

Delivered by FeedBurner