Aplikasi Sederhana MDI Form pada
Visual Studio 2010 (Menu, Tool, MDI Form)
1. Buka Microsoft Visual Studio 2010
2. Desain Form pertama seperti ini:
2. Desain Form pertama seperti ini:
- Buat 3 form( form 1, form2, form3)
4. - Gunakan MenuStrip untuk mendesain
File, Latihan, Tugas, dll terserah.
5. - Properti IsMDIContainer
pada form 1 diganti menjadi true
6. - Tambahkan Standar bar dengan
menggunakan ToolStrip
Gunakan Dock pada propertis Untuk memindahkan
tempat standar bar dikiri, kanan, atas atau tengah.
*Untuk
menggabungkan antara form1 dan form yang lain maka setiap form kasih coding
seperti dibawah ini:
Membuat Ribbon Menggunakan
Aplikasi DotNetBar.
1. Instal
terlebih dahulu DotNetBar
2. Masuk ke Microsof Visual Studio 2010
3. Buat Form seperti biasa.
4. Lalu ke tool DotNetBar
5. Untuk Penggunaan DotNetBar tutorialnya bisa dilihat di link dibawah http://www.devcomponents.com/dotnetbar/movies.aspx#
2. Masuk ke Microsof Visual Studio 2010
3. Buat Form seperti biasa.
4. Lalu ke tool DotNetBar
5. Untuk Penggunaan DotNetBar tutorialnya bisa dilihat di link dibawah http://www.devcomponents.com/dotnetbar/movies.aspx#
Form 2
Codingnya seperti dibawah ini:
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
Coding:
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 dan kita pilih cascade maka hasilnya akan seperti ini:
Tampilan
Cascade
Tampilan Cacade
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
Dan
horisontal seperti dibawah ini:
Tampilan
TileHorisontal
Me.LayoutMdi(MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
Dan yang
terakhir vertikal:
Tampilan
Tile secara Vertical
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
Coding Untuk Keseluruhanya
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
Private Sub ButtonItem17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem17.Click
Form3.Show()
End Sub
Private Sub ButtonItem24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem24.Click
Form2.Show()
End Sub
Private Sub ButtonItem29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem29.Click
Me.Close()
End Sub
Private Sub ButtonItem30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem30.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem31.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem32_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem32.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem13.Click
Me.Close()
End Sub
Private Sub ButtonItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem8.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem11.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem9.Click
Form3.Show()
End Sub
Private Sub ButtonItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem10.Click
Form2.Show()
End Sub
Private Sub ButtonItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem5.Click
Form2.Show()
End Sub
Private Sub ButtonItem33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem33.Click
Form3.Show()
End Sub
Private Sub ButtonItem34_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem34.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem14_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem14.Click
Form2.Show()
End Sub
Private Sub ButtonItem35_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem35.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
End Class
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
Private Sub ButtonItem17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem17.Click
Form3.Show()
End Sub
Private Sub ButtonItem24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem24.Click
Form2.Show()
End Sub
Private Sub ButtonItem29_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem29.Click
Me.Close()
End Sub
Private Sub ButtonItem30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem30.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem31_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem31.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem32_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem32.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem13.Click
Me.Close()
End Sub
Private Sub ButtonItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem8.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem11.Click
Me.LayoutMdi(Windows.Forms.MdiLayout.TileHorizontal)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem9.Click
Form3.Show()
End Sub
Private Sub ButtonItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem10.Click
Form2.Show()
End Sub
Private Sub ButtonItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem5.Click
Form2.Show()
End Sub
Private Sub ButtonItem33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem33.Click
Form3.Show()
End Sub
Private Sub ButtonItem34_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem34.Click
Me.LayoutMdi(MdiLayout.Cascade)
Form2.Show()
Form3.Show()
End Sub
Private Sub ButtonItem14_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem14.Click
Form2.Show()
End Sub
Private Sub ButtonItem35_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonItem35.Click
Me.LayoutMdi(MdiLayout.TileVertical)
Form2.Show()
Form3.Show()
End Sub
End Class
Tidak ada komentar:
Posting Komentar