473,796 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send objects to MDIParent

Rob
Hello,
I can easily send data types from any MDI parent to an MDI Child
window using something like MDIChild( i ).ChildSubrouti ne( i2 ), which
would call the Public subroutine ChildSubroutine in my Child Form and
send the parameter integer i2. However I cannot figure out how to call a
Public subroutine contained in the MDIParent from the MDIChild.

Please help RS, TIA

Nov 21 '05 #1
6 2571
Rob

Me.mdiparent.my method (assuming the method is friend or public)

I hope this helps,

Cor
Nov 21 '05 #2
Rob
Sorry, but the Me.mdiparent.my method () does not work. I wish it
was that easy.

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:Ob******** ******@TK2MSFTN GP15.phx.gbl...
Rob

Me.mdiparent.my method (assuming the method is friend or public)

I hope this helps,

Cor

Nov 21 '05 #3
Rob,

Sorry I did it to quick

DirectCast(Me.M diParent, FormMdiParent). MyMethodInFormM diParent()

I hope this helps,

Cor
Nov 21 '05 #4
Rob wrote:
Sorry, but the Me.mdiparent.my method () does not work. I wish it
was that easy.

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:Ob******** ******@TK2MSFTN GP15.phx.gbl...
Rob

Me.mdiparent. mymethod (assuming the method is friend or public)

I hope this helps,

Cor



Why doesn't it work? Is MdiParent set to nothing or can you not see the
method you want to work against? You may have to cast mdiparent to
whatever form type mdiparent is and then use the method.

Chris
Nov 21 '05 #5
Rob
Cor Ligthert,

This is the routine I am attempting to execute in the Parent Form:
Public Sub SetAppropriateW indow(ByVal i As Integer)

'use parameter i for something

End Sub

and the routine that is the child form is:

Private Sub Button1_Click_1 (ByVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

'Call SetAppropriateW indow of MDIParent

DirectCast( Me.MdiParent, FormMdiParent ).SetAppropriat eWindow(3)

t1 = New Thread(AddressO f AmibrokerThread )

t1.Start()

End Sub

that second parameter " FormMdiParent " , where can I get that parameter ?

Also, in MS Visual J if I wanted to communicate between 2 Forms I had to

go through an Interface class, does that also apply to VB.NET ?

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Rob,

Sorry I did it to quick

DirectCast(Me.M diParent, FormMdiParent). MyMethodInFormM diParent()

I hope this helps,

Cor

Nov 21 '05 #6
Rob,
DirectCast( Me.MdiParent, FormMdiParent ).SetAppropriat eWindow(3)

That FormMdiParent is in my sample a substitute for the name of the class
from the parent.

When you set there the right name it should work in my opinion.

It is not really nice OOP, however because that a mdiform is always a child
of a certain parent, would I not know what there practical can be an
objection in this case.

I hope this helps,

Cor
Nov 21 '05 #7

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

Similar topics

1
1773
by: Satish | last post by:
Hi, I am facing problem with, sending data frm mdi child to mdi parent. I have search Dropdown in MDI form, depend on selection, or enter string(its like IE URL functionality) and click search button, i am displaying Details form with all the details. Their i have Delete button. When we click on delete button, we have to delete the record from database and at the same time, i have to delete record from the drop down.
1
5323
by: yin heng | last post by:
I am using c#2005 Beta to write a Mdi form, but I can't find the MDI properties as: IsMdiChild or MdiParent. I am a beginner of c#, is it the difference between .net 2003 edition and 2005 beta? If i want to generate Mdi, how can I generate child form? thank you.
1
1412
by: Dursun | last post by:
I need to call a subroutine (CreateNewDoc()) in FormA from within FormB based on the user action in FormB. Let FormA be an MDIForm and let FormB be its MDIChild form (during the creation of FormB, MDIParent property was populated properly). So, the FormB.MDIParent (or from within FormB, "me.MDIParent") will (should?) return an object refernce to the FormA instance (I am not sure if this is a correct assumption... please read along). At...
26
1960
by: Paul Mars | last post by:
FormParent load opens FormChildA. FormChildA btn click opens FormChildB. (FormChildA and FormChildB are both children of FormParent) (FormChildA and FormChildB are different forms) Problem: FormChildA btn click can only open one instance for FormChildB. I need multiple instances of FormChildB. Any suggestions or ideas please.
4
3120
by: Ben dotNet | last post by:
FormA is the mdiParent FormB is the child FormC is the Form that is used to open FormB How do I open FormB from FormC (that is not a child) so that it it's mdiParent is FormA? Thanks, --Ben
4
1439
by: Maarten | last post by:
i have a parrent form, form1 and i child form, form2 when i press a button in form2, tha data of the text1 of form2 must be places in text1 of form1 something like form1.text1 = form2.text1 (won't work) this is an example, i'm planning to do this with the data of listboxes.
1
2472
by: Roy | last post by:
Hi all, I'm opening a mdichild (Form2) within another mdichild (Form1). In Form1 I have: Form2.MdiParent = Me.MdiParent 'No problem here .... .... If Form2.ShowDialog = DialogResult.OK Then 'I get an error message here. This is the error: Forms that are not top level forms cannot be displayed as modal dialog. Remove the form from any parent form before calling ShowDialog. When I remove:
1
1787
by: PDP-8E | last post by:
I'm new to VB.Net 2003 - (2 weeks in) so this MAY be straightforward... (Things changed since Octal Assembler I see !!!) I'll try to lay this out in a way that makes sense I created a MdiParent form In that form I want Child forms to apear BASED ON BUTTON Control Click Event The Child needs to appear in the same location - Basically, turn ChildForm1
0
1656
by: kardiss | last post by:
I am trying to add Meebo's "Pop-out" kinda feature to my application which when a button is pressed in a MdiChild form, it kicks that MdiChild form out of the MdiParent boundary and acts like a SDI form of itself. When a button is pressed again, it is kicked back into the parent form. Everything is working fine except one problem. When the MdiChild form is kicked back into the form, I have to click the title bar of each MdiChild form to...
0
9679
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10453
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.