Selasa, 11 Desember 2012

Tugas PV7

Tugas 7 Pemograman Visual
MENU
Digunakan untuk mengorganisasikan semua Form dan laporan pada aplikasi yang dibuat, Sehingga dapat di panggil dengan mudah
Jenis menu
Menu Strip
Biasa disebut menu utama
Menu Context
Menu yang di aktifkan dengan click kanan
4 contoh menu Mdi child


Cukup dengan koding yang sederhana seperti berikut :
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

Private Sub Form2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form2ToolStripMenuItem.Click
Form3.MdiParent = Me
Form3.Show()
End Sub

Private Sub Form3ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form3ToolStripMenuItem.Click
Form4.MdiParent = Me
Form4.Show()
End Sub

Private Sub Form4ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form4ToolStripMenuItem.Click
Form5.MdiParent = Me
Form5.Show()
End Sub

Private Sub Form1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form1ToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
End Sub

Jika dilajankan akan menjadi seperti berikut :


Note :
Untuk icon pda anak form menggunakan klik kanan kemudian set image sedangkan untuk background pada form 1-4 menggunakan BackgroundImage pada Properties form
MENU-MENU WINDOWS



Gunakan koding sederhana seperti berikut
Private Sub CascadeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CascadeToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub

Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TileHorizontalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub

Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TileVerticalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub

Maka jika dijalankan kan seperti berikut
1. Cascade



2. Tile Horizontal



3. Tile Vertical