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

Getting data from mdichild to mdiparent

Hello all

I have 2 questions
First: I'm trying to print a Listview from an mdichild but how can i
address this listview.

For example,

FrmMain is my Main form.
In this Main form I have several mdichildren.
When i press the print button, I want to print the Listview on the
active mdichild,

But how can i address that.

I'm thinking of something like this.

dim oF as new Form
of = me.activemdichild

printing(of.listview1)

Is this correct or how can i address it

Second question:

When I do a mouseover event on a Textbox in my MdiChild I want to
address a Label on my MdiParent that gives information about that
specific Textbox

How can i do this, I think with Delegates but I'm not sure, If someone
could give me an example, I would be very grateful,

Thanks in advance, and sorry about my bad English but I'm from Belgium

Feb 7 '07 #1
2 1851
"Thorgal" <de************@yahoo.comschrieb
Hello all

I have 2 questions
First: I'm trying to print a Listview from an mdichild but how can i
address this listview.

For example,

FrmMain is my Main form.
In this Main form I have several mdichildren.
When i press the print button, I want to print the Listview on the
active mdichild,

But how can i address that.

I'm thinking of something like this.

dim oF as new Form
"New" doesn't make sense here. The reference is overwritten in the next line
anyway.
of = me.activemdichild

printing(of.listview1)

Is this correct or how can i address it
The type of variable 'of' is 'Form'. Not every Form has a property called
'listview1', thus it doesn't work. You must check whether the type of the
active Form is the one with a listview called 'listview1'. If it is, cast to
that type, in order to access the listview:

if typeof of is MyChildWithATreeview then
dim f as MyChildWithATreeview = directcast(of, MyChildWithATreeview)
printing(f.Listview1)
end if

Second question:

When I do a mouseover event on a Textbox in my MdiChild I want to
address a Label on my MdiParent that gives information about that
specific Textbox

How can i do this, I think with Delegates but I'm not sure, If
someone could give me an example, I would be very grateful,
There are many ways to do this. It also depends on where the additional
information for the textbox is stored and how the textboxes are created
(designer?).

I would probably store the additional information as an additional property
of the textbox, which means deriving a class from Textbox and adding the
property. At run time, after the Form and it's textboxes have been created,
raise an event. Catch the event in the MDI parent. In the event handler, use
a loop to retrieve all Textboxes of that type. For each Textbox found, add a
handler to the MouseOver event. The handler is part of the MDI parent. There
you can display the additional information.

Another way is to "bubble" the event: Handle the MouseOver event in the Mdi
child. You can use one single event handler for this. In the child, raise an
event that is caught by the Mdi parent. In the parent, display the
additional information. ... Thinking about it, the 2nd solution is probably
the simpler one.
Thanks in advance, and sorry about my bad English but I'm from
Belgium
Sorry about mine, I'm from Germany. :-) (and I think yours isn't bad at
all!)
Armin

Feb 7 '07 #2
Thjorgal,

In my expirience is the use of the MDI collection in the MDIparent the most
easy way to transfer data from one to another.

Cor
"Thorgal" <de************@yahoo.comschreef in bericht
news:11**********************@a34g2000cwb.googlegr oups.com...
Hello all

I have 2 questions
First: I'm trying to print a Listview from an mdichild but how can i
address this listview.

For example,

FrmMain is my Main form.
In this Main form I have several mdichildren.
When i press the print button, I want to print the Listview on the
active mdichild,

But how can i address that.

I'm thinking of something like this.

dim oF as new Form
of = me.activemdichild

printing(of.listview1)

Is this correct or how can i address it

Second question:

When I do a mouseover event on a Textbox in my MdiChild I want to
address a Label on my MdiParent that gives information about that
specific Textbox

How can i do this, I think with Delegates but I'm not sure, If someone
could give me an example, I would be very grateful,

Thanks in advance, and sorry about my bad English but I'm from Belgium

Feb 7 '07 #3

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

Similar topics

0
by: Supra | last post by:
i got mdichild working. i'm working on similar to mirc chat. when i joined channel #vb the first mdichild is on. then when i wanted to join another channel #visualbasic. then i got second mdichild...
5
by: pei_world | last post by:
hi I have a app with one MDIparent and many MDIchildren forms I want to know a way such that those MDIchildren forms can communicate freely. I means, call any public function without creating an...
6
by: Claus Holm | last post by:
I'm trying to enable a menuitem in the parent form from a mdichild. Rather than making the menuitems public, I'd go for a public method in the parent form to do the change, but when I call the...
2
by: SpotNet | last post by:
Hello NewsGroup, I have a MDIParent form with a docked left treeview control, a splitter control and a generic docked control on the right. Kind of looks like Windows Explorer, though it's...
1
by: Deep Phee | last post by:
Working with VB.Net I'm using a MdiParent form, bringing a child form as follows: Dim frmMaintenance As New frmMaintenance frmMaintenance.MdiParent = Me ' Display the child form. ...
0
by: Supra | last post by:
i got mdichild working. i'm working on similar to mirc chat. when i joined channel #vb the first mdichild is on. then when i wanted to join another channel #visualbasic. then i got second mdichild...
10
by: Chris Petchey | last post by:
My App is an MDI Parent with MDI Child forms. One of the child forms calls a modal dialog form. I would like the modal dialog form to be INSIDE the mdi parent window. I am not bothered about...
3
by: MuZZy | last post by:
Hi, I wounder if someone could help me here: app has an MdiParent form - i need to get some notification in form of an event when any MdiChild forms are added to/removed from...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.