pada posting kali ini saya akan memaparkan beberapa cara membuat menu pada program MICROSOFT VISUAL STUDIO 2010.Apliaksi yang nantinya kita akan buat seperti yang kita liat di bawah ini
Pada gambar di atas terdapat 3 menu, Context,toolstrip, dan tab control yang letaknya berbeda dan memiliki fungsi tertentu,berikut beberapa cara dalam membuat menu dalam aplikasi VB.NET
1. Membuat Menu Context Strip
Gambar di atas terdapat menu FILE yang berisi Data baru,Laporan Baru, Tugas Baru dan Keluar, gunakan menu CONTEXTMENUSTRIP pada toolbox seperti gambar di samping
2 .Membuat Menu Library
Selanjutnya kita akan membuat menu Library dengan menggunakan TAB CONTROL, tab control ini merupakan menu yang memiliki beberapa tab yang berisi tool sesuai kategori, pada aplikasi ini terdapat dua kategori yaitu Menu dan tampilan, Menu berisi beberapa menu yaitu data,laporan,tugas semua yang memiliki fungsi memanggil form lain
Dan pada menu TAMPILAN terdapat beberapa menu yaitu Vertikal, Horizontal, Casecade yang memiliki untuk menata form yang terbuka
3.Membuat menu Tool Strip
membuat menu toolstrip pada menggunakan pada Toolbox sebelah kiri,dan hasilnya seperti gambar di bawah ini
pada aplikasi ini juga bisa membuat Shortcut key menelalu propertis pada menu yang akan di sisipi shortcut,perhatikan gambar berikut
BERIKUT CODING YANG DIGUNAKAN UNTUK MEMBUAT APLIKASI INI
Public Class Form1
Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click
Form3.MdiParent = Me
Form3.Show()
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub KeluarToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem1.Click
Me.Close()
End Sub
Private Sub TugasBaruToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TugasBaruToolStripMenuItem1.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub VertikalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VertikalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
Private Sub HorizontalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HorizontalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
Private Sub CasecadeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CasecadeToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form4.Show()
End Sub
Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Form3.MdiParent = Me
Form3.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
Private Sub Button6_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form3.MdiParent = Me
Form3.Show()
Form2.MdiParent = Me
Form2.Show()
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub HelpToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripButton.Click
MsgBox("jika anda mengalami kendala dalam menjalankan aplikasi ini,silahkan anda hubungi pembuat atau dosen yang bersangkutan ^_^.....")
End Sub
End Class
Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click
Form3.MdiParent = Me
Form3.Show()
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub KeluarToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem1.Click
Me.Close()
End Sub
Private Sub TugasBaruToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TugasBaruToolStripMenuItem1.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub VertikalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VertikalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
Private Sub HorizontalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HorizontalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
Private Sub CasecadeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CasecadeToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form4.Show()
End Sub
Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Form3.MdiParent = Me
Form3.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
Private Sub Button6_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form3.MdiParent = Me
Form3.Show()
Form2.MdiParent = Me
Form2.Show()
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub HelpToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HelpToolStripButton.Click
MsgBox("jika anda mengalami kendala dalam menjalankan aplikasi ini,silahkan anda hubungi pembuat atau dosen yang bersangkutan ^_^.....")
End Sub
End Class
TERIMAKASIH.....SEMOGA BERMANFAAT
0 comments:
Post a Comment