Multiple Pictures Box Project

Form 1
Public Class MdiParent

Private Sub TileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWindow.Click

End Sub

Private Sub mnuFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFile.Click
' If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
'Dim oform As New FrameStyle
'oform.MdiParent = Me


'End If
End Sub

Private Sub mnuFileOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileOpen.Click
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim oform As New PictureView
oform.MdiParent = Me
oform.Picture = Image.FromFile(OpenFileDialog1.FileName)
oform.Show()

End If
End Sub

Private Sub mnuFileExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileExit.Click
Me.Close()
End Sub

Private Sub mnuWindowHorizontally_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWindowHorizontally.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)


End Sub

Private Sub mnuWindowVertically_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWindowVertically.Click
Me.LayoutMdi(MdiLayout.TileVertical)

End Sub

Private Sub mnuWindowCascade_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWindowCascade.Click
Me.LayoutMdi(MdiLayout.Cascade)

End Sub

Private Sub mnuWindowArrangeIcon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWindowArrangeIcon.Click
Me.LayoutMdi(MdiLayout.ArrangeIcons)
End Sub
End Class
Form 2
Public Class PictureView

Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

End Sub
Public Property Picture() As Image
Get
Return PictureBox1.Image


End Get
Set(ByVal value As Image)
PictureBox1.Image = value
End Set
End Property
End Class

No comments:

Post a Comment