473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How can I set the MDI Parent property

How can I set the MDI Parent property for a child form
from that child form itself?
Nov 20 '05 #1
4 1270
me.mdiparent = frmparent (but you will have to declare the frmparent as a
public shared instance of your parent form)

eric

"suresh" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
How can I set the MDI Parent property for a child form
from that child form itself?

Nov 20 '05 #2
"suresh" <an*******@discussions.microsoft.com> schrieb
How can I set the MDI Parent property for a child form
from that child form itself?


??

Maybe
Me.MdiParent = TheParentForm
?

But why do you need this?

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
* "suresh" <an*******@discussions.microsoft.com> scripsit:
How can I set the MDI Parent property for a child form
from that child form itself?


\\\
Me.MdiParent = <reference to MDI container>
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
suresh,
In addition to the others, I will sometimes define a second constructor in
the child form that accepts the parent, then use that to set it.

Something like:

Public Class ChildForm
Inherits Form

' designer needs this, others do not
Private Sub New()
InitializeComponent()
End Sub

Public Sub New(parentForm As Form)
MyClass.New()
me.MdiParent = parentForm
End Sub

...

End Class

Hope this helps
Jay

"suresh" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
How can I set the MDI Parent property for a child form
from that child form itself?

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Zürcher See | last post by:
The Control class has the Parent property that is readonly. When the control is added to a controls collection of another control the Parent property refers to that control. "Who" set the Parent...
2
by: Jim Shank | last post by:
I am really trying to find the best OOP way of doing this. I have a parent MDI form with multiple children and I am trying to communicate variables between them. I have been able to successfully...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
10
by: Goran Djuranovic | last post by:
Hi all, Does anyone know how to declare a variable in a class to be accessible ONLY from a classes instantiated within that class? For example: ************* CODE ***************** Public...
1
by: Yuk Tang | last post by:
Leading on from a recent topic, "How does child class access parent's variables", I would like to ask, what's the most elegant way of changing a parent/grandparent/great-grandparent's property? ...
1
by: Charles Zhang | last post by:
I created a custom server control that derives from WebControl. I found Parent and Page property are null for the control I created. But Parent is a readonly property so that I have no way to...
8
by: RSH | last post by:
Hi, I have a situation where I have a Parent Object (Company) which has several public properties. The Company Object also creates an Employees object which has its ow set of functions and...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
1
by: IframeLearner | last post by:
Hi , I am trying to upload a file from a parent.jsp using Iframes. From Parent page. I have to save Subject, Desc, File and file name. to upload the file i am using Iframe. I want the...
3
by: =?Utf-8?B?RGF2ZVA=?= | last post by:
I've got a situation in a VB 2003 Windows application with an MDI form and a child form. In certain situations, when the child is closed by the user, I also want to close the MDI parent. Is there...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.