By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,761 Members | 1,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,761 IT Pros & Developers. It's quick & easy.

MDI in VB.net

P: n/a

Do any1 know how to transfer an image from an MDI Child to its paren
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 A
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 For
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 Su
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.StretchIma ge
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.CenterScree n
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
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
As System.EventArgs) Handles cmSelect.Click
If Selection = False Then
SelectPic()
Selection = True
Else

End If

End Sub
End Clas

--
EkokuPosted from http://www.pcreview.co.uk/ newsgroup acces

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
"Ekoku" <Ekoku.1shhra@> schrieb:
Do any1 know how to transfer an image from an MDI Child to its parent


In the MDI child:

\\\
DirectCast(Me.MdiParent, MainForm).PictureBox1.Image = ...
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.