Tugas kali ini tentang menu, toolbar, dan MDI form dimana kita akan membuat suatu aplikasi yang menggunakan toolbox menus & tollbars,yang disitu terdapat menu ContextMenuStrip, MenuStrip, StatusStrip, ToolStripContainer, ToolStrip yang nanti akan kita gunakan:
pada gambar diatas kita gunakan MenuStrip dan ToolStrip,diatas saya tambah kan menu latihan, tugas, dan Exit,selain dari menu standar file, edit, tools, dan help.
pada menu latihan dan tugas terdapat beberapa latihan dan tugas yang nantinya bisa kita buka,
pada menu latihan dan tugas terdapat beberapa latihan dan tugas yang nantinya bisa kita buka,
setelah form yang telah kita buka tadi,kita bisa membuat form-form itu menjadi berurutan atau cascade,dengan mengklik icon cascade yang telah ada,dengan mengklik icon cascade maka akan menghasilkan sebagai berikut:
terdapat juga pilihan lain selain cascade yaitu horizontal dan vertical,pada icon yang telah tersedia
hasil dari icon horizontal
hasil dari icon horizontal
Hasil dari icon Vertical:
pada menu Tugas saya menggunakan showdialog,dan apabila telah dibuka maka tidak bisa membuka form lain,
sort program:
Public Class Form1
Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub ToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem4.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem3.Click
Form3.MdiParent = Me
Form3.Show()
End Sub
Private Sub ExitToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem1.Click
If MsgBox("Anda yakin akan keluar dari apikasi ini?", vbQuestion + vbYesNo + vbDefaultButton2, "Keluar") = MsgBoxResult.Yes Then Me.Close()
End Sub
Private Sub ToolStripMenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem5.Click
Form2.ShowDialog()
End Sub
Private Sub ToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem6.Click
Form3.ShowDialog()
End Sub
Private Sub ToolStripMenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem7.Click
Form4.ShowDialog()
End Sub
Private Sub Cascade_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cascade.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
End Class
Public Class Form1
Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub ToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem4.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem3.Click
Form3.MdiParent = Me
Form3.Show()
End Sub
Private Sub ExitToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem1.Click
If MsgBox("Anda yakin akan keluar dari apikasi ini?", vbQuestion + vbYesNo + vbDefaultButton2, "Keluar") = MsgBoxResult.Yes Then Me.Close()
End Sub
Private Sub ToolStripMenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem5.Click
Form2.ShowDialog()
End Sub
Private Sub ToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem6.Click
Form3.ShowDialog()
End Sub
Private Sub ToolStripMenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem7.Click
Form4.ShowDialog()
End Sub
Private Sub Cascade_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cascade.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
End Class
0 komentar:
Posting Komentar