Tugas 7 (tujuh)
MDI FORM
Form 1 seperti dibawah ini :
Ubah Properti IsMDIContainer pada form 1 menjadi true
Gunakan Dock pada propertis Untuk memindahkan tempat standar bar dikiri, kanan, atas atau tengah.
Untuk Form 2
Codingnya
Public Class Form2
Private Sub
Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.MdiParent
= Form1
End Sub
End Class
Dan form 3
Public Class Form3
Private Sub
Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.MdiParent
= Form1
End Sub
End Class
Setelah di Run pada windows kita pilih
cascade hasilnya seperti ini:
Dan horisontal seperti ini:
Dan yang terakhir vertikal:
Dan cascade :
Coding pada form 1::
Public Class Form1
Private Sub
Tugas1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Tugas1ToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub
Latihan1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Latihan1ToolStripMenuItem.Click
Form2.MdiParent
= Me
Form2.Show()
End Sub
Private Sub
Latihan2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Latihan2ToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub
CascadeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
CascadeToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub
TileHorizontalToolStripMenuItem_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
TileHorizontalToolStripMenuItem.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub
TileVerticalToolStripMenuItem_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
TileVerticalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
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
ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
ToolStripButton1.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
Private Sub
ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub
ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
ToolStripButton2.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
End Class
Membuat Menu dengan Library tambahan (menu
ribbon)
untuk membuat menu ribbon saya menggunakan dotnetbar
dengan cara drag nd drop
dan hasil nya seperti ini
Berikut semua coding
nya :
Public Class Form1
Private Sub Tugas1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tugas1ToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub Latihan1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Latihan1ToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub Latihan2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Latihan2ToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub CascadeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CascadeToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TileHorizontalToolStripMenuItem.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TileVerticalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
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 ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form2.Show()
End Sub
Private Sub ButtonItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form2.Show()
End Sub
Private Sub ButtonItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Private Sub ButtonItem15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem15.Click
Form2.Show()
End Sub
Public Class Form1
Private Sub Tugas1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tugas1ToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub Latihan1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Latihan1ToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub Latihan2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Latihan2ToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub CascadeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CascadeToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TileHorizontalToolStripMenuItem.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TileVerticalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
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 ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form2.Show()
End Sub
Private Sub ButtonItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Form2.Show()
End Sub
Private Sub ButtonItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Private Sub ButtonItem15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem15.Click
Form2.Show()
End Sub
Sekian terimakasih...
^_^
Komentar
Posting Komentar