473,386 Members | 1,798 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,386 software developers and data experts.

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 ).ChildSubroutine( 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 2556
Rob

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

I hope this helps,

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

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

Me.mdiparent.mymethod (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.MdiParent, FormMdiParent).MyMethodInFormMdiParent()

I hope this helps,

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

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Ob**************@TK2MSFTNGP15.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 SetAppropriateWindow(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.EventArgs) Handles Button1.Click

'Call SetAppropriateWindow of MDIParent

DirectCast( Me.MdiParent, FormMdiParent ).SetAppropriateWindow(3)

t1 = New Thread(AddressOf 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****************@TK2MSFTNGP09.phx.gbl...
Rob,

Sorry I did it to quick

DirectCast(Me.MdiParent, FormMdiParent).MyMethodInFormMdiParent()

I hope this helps,

Cor

Nov 21 '05 #6
Rob,
DirectCast( Me.MdiParent, FormMdiParent ).SetAppropriateWindow(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
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...
1
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?...
1
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,...
26
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:...
4
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
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 =...
1
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...
1
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...
0
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.