MDI in VB.net

Joined
Jul 20, 2005
Messages
2
Reaction score
0
Do any1 know how to transfer an image from an MDI Child to its parent plz? 10x alot

Below is my code:

Public Class frmPhotoWindow
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents picThumb As System.Windows.Forms.PictureBox
Friend WithEvents cmPic As System.Windows.Forms.ContextMenu
Friend WithEvents cmSelect As System.Windows.Forms.MenuItem
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.picThumb = New System.Windows.Forms.PictureBox
Me.cmPic = New System.Windows.Forms.ContextMenu
Me.cmSelect = New System.Windows.Forms.MenuItem
Me.SuspendLayout()
'
'picThumb
'
Me.picThumb.ContextMenu = Me.cmPic
Me.picThumb.Location = New System.Drawing.Point(0, 0)
Me.picThumb.Name = "picThumb"
Me.picThumb.Size = New System.Drawing.Size(232, 160)
Me.picThumb.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.picThumb.TabIndex = 0
Me.picThumb.TabStop = False
'
'cmPic
'
Me.cmPic.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.cmSelect})
'
'cmSelect
'
Me.cmSelect.Index = 0
Me.cmSelect.Text = "Select"
'
'frmPhotoWindow
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(224, 158)
Me.Controls.Add(Me.picThumb)
Me.Name = "frmPhotoWindow"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.ResumeLayout(False)

End Sub

#End Region
Dim Selection As Boolean = False
Dim main As frmMainLayout
Private Sub frmPhotoWindow_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Height = 192
Me.Width = 240
Me.Text = "Photo [" & Selection & "]"
Dim Photo As New PictureBox
Photo.Width = 160
Photo.Height = 232
Photo.SizeMode = PictureBoxSizeMode.StretchImage
End Sub

Private Sub SelectPic()

Dim SelectPhoto As Image
SelectPhoto = picThumb.Image


main.SelectedPic = SelectPhoto

End Sub
Private Sub picThumb_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picThumb.Click
If Selection = False Then
SelectPic()
Selection = True
Else

End If

End Sub

Private Sub cmSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmSelect.Click
If Selection = False Then
SelectPic()
Selection = True
Else

End If

End Sub
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top