MDI Form
Desain 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
untuk form 3
Codingnya.
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
Dan form 4
Codingnya.
Private
Sub
Latihan3ToolStripMenuItem_Click(ByVal
sender As
System.Object,
ByVal
e As
System.EventArgs)
Handles
Latihan3ToolStripMenuItem.Click
Form5.ShowDialog()
End
Sub
Setelah di Run pada windows kita pilih
cascade hasilnya seperti ini:
Horisontal
seperti ini:
Vertikal seperti ini:
Dan yang
terakhir untuk form 5
Listin 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
Private
Sub
Latihan3ToolStripMenuItem_Click(ByVal
sender As
System.Object,
ByVal
e As
System.EventArgs)
Handles
Latihan3ToolStripMenuItem.Click
Form5.ShowDialog()
End
Sub
End
Class
09.34 |
Category: |
0
komentar
Comments (0)