Minggu, 09 Desember 2012

Tugas 7



“MDI FORM”
Untuk Form 1

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


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:


Horisontal seperti ini:



Vertikal:







Coding 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


Tidak ada komentar:

Posting Komentar