Senin, 10 Desember 2012

Tugas 7 MDI Form Child-Parrent & Ribbon Toolbar



Kali ini saya akan menerangkan tentang MDI Form – MDI Child membuat layer MDI Child berbentuk Cascade, Horizontal, dan Vertical, & membuat Tollbox Ribbon yang di jelaskan berikut ini....
1.      Buka Ms. Visual Basic.
2.      Buatlah Form induk MDI form seperti dibawah ini,










Buatlah 3 form( form 1, form2, form3)
3.      Gunakan MenuStrip untuk mendesain File, Latihan, Tugas, dll
4.      GantiProperti IsMDIContainer pada form 1menjadi true
5.      Tambahkan Standar bar dengan menggunakan ToolStrip
Gunakan Dock pada propertis Untuk memindahkan tempat standar bar dikiri, kanan, atas atau tengah.
6.      Menambahkan Ribbon
Untuk menggabungkan antara form1 dan form yang lain maka setiap form kasih coding seperti dibawah ini:

Ÿ Instal terlebih dahulu applikasi DotNetBar tersebut
Ÿ Masuk ke Microsof Visual Studio 2010
Ÿ Buat Form seperti biasa.
Ÿ Lalu ke tool DotNetBar
Ÿ Dan desain Ribbon’nya....




7.      Jangan lupa untuk memasukan “ContexMenuStrip” untuk bisa mengaktifkannya kilk kanan pada form dan groupbox “Latihan”. ContexMenuStrip1 untuk form 1, dan ContexMenuStrip2 untuk groupbox.
                        ContexMenuStrip1 berisi latihan.
                        ContexMenuStrip2 untuk membuat layout.
8.      Lalu dit form 2 dan 3 sebagai berikut :
Form 2.
Codingnya adalah :
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








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










9.      Masukan coding form 1
Public Class Form1
    Private Sub Latihan1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Latihan1ToolStripMenuItem.Click
        Form2.Show()

    End Sub

    Private Sub ExitToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem1.Click
        Me.Close()

    End Sub

    Private Sub Ltihan2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Ltihan2ToolStripMenuItem.Click
        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 HorizontalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HorizontalToolStripMenuItem.Click
        Me.LayoutMdi(MdiLayout.TileHorizontal)
        Form2.Show()
        Form3.Show()

    End Sub

    Private Sub VerticalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VerticalToolStripMenuItem.Click
        Me.LayoutMdi(MdiLayout.TileVertical)
        Form2.Show()
        Form3.Show()

    End Sub

    Private Sub ButtonItem14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem14.Click
        Form2.Show()

    End Sub

    Private Sub ButtonItem15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem15.Click
        Form3.Show()

    End Sub

    Private Sub ButtonItem16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem16.Click
        Form2.Show()
        Form3.Show()

    End Sub

    Private Sub ButtonItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem1.Click
        Me.LayoutMdi(MdiLayout.Cascade)
        Form2.Show()
        Form3.Show()

    End Sub

    Private Sub ButtonItem17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem17.Click
        Me.LayoutMdi(MdiLayout.TileHorizontal)
        Form2.Show()
        Form3.Show()

    End Sub

    Private Sub ButtonItem18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem18.Click
        Me.LayoutMdi(MdiLayout.TileVertical)
        Form2.Show()
        Form3.Show()
    End Sub

    Private Sub ButtonItem19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem19.Click
        Me.Close()

    End Sub

    Private Sub Latihan1ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Latihan1ToolStripMenuItem1.Click
        Form2.Show()

    End Sub

    Private Sub Latihan2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Latihan2ToolStripMenuItem.Click
        Form3.Show()

    End Sub

    Private Sub CascadeToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.LayoutMdi(MdiLayout.Cascade)
        Form2.Show()
        Form3.Show()

    End Sub

    Private Sub HorizotalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.LayoutMdi(MdiLayout.TileHorizontal)
        Form2.Show()
        Form3.Show()

    End Sub

    Private Sub VerticalToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.LayoutMdi(MdiLayout.TileVertical)
        Form2.Show()
        Form3.Show()

    End Sub

    Private Sub CasecadeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CasecadeToolStripMenuItem.Click
        Me.LayoutMdi(MdiLayout.Cascade)
        Form2.Show()
        Form3.Show()
    End Sub

    Private Sub HorizontalToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HorizontalToolStripMenuItem1.Click
        Me.LayoutMdi(MdiLayout.TileHorizontal)
        Form2.Show()
        Form3.Show()
    End Sub

    Private Sub VerticalToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VerticalToolStripMenuItem2.Click
        Me.LayoutMdi(MdiLayout.TileVertical)
        Form2.Show()
        Form3.Show()
    End Sub
End Class

Hasil Layout
Casacade




Horizontal

Vertical

Tidak ada komentar:

Posting Komentar