|
-
Sep 21st, 2006, 03:41 AM
#1
Thread Starter
Lively Member
[RESOLVED] Data passing between mdi child forms
hi guys,
i would really like an easy way to pass values between child forms. i've read a tutorial on the net and sad to say i couldnt understand it.
i have 2 child forms namely child 1 and chid 2 under one parent form parent 1. i want child 1 to pass values to child 2 and vice versa.
any suggestions?
regards
-
Sep 21st, 2006, 04:19 AM
#2
Addicted Member
Re: Data passing between mdi child forms
using VB 2010 .NET Framework 4.0; MS Office 2010; SQL Server 2008 R2 Express Edition | Remember to mark resolved threads and rate useful posts. 
-
Sep 21st, 2006, 04:25 AM
#3
Re: Data passing between mdi child forms
Let's say that you and I have a mutual friend. We both know him but we don't know each other. I can't get in touch with you because I have no way specific path to get to you. I could give our mutual friend a message, who has both our phone numbers, and he could pass it on to you. Alternatively I could get your phone number from our mutual friend and then I could contact you directly.
In the situation above we are the child forms and our mutual friend is the parent. Neither child form knows about the other, but each has a reference to its parent in its MdiParent property. The parent form has a reference to each child in its MdiChildren property and any other references that it may have kept when the child forms were created. Now, one child can access a member of the parent form, which can then access a member of the other child. Alternatively the parent could pass one child a reference to the other and then that child can access members of the other child directly.
OOP is designed to mimic real life. In real life you cannot affect something if you have no way to "touch" it. In OOP, if you don't have a reference to an object then you can't access it's members.
I suggest that you read the "Forms in VB.NET" tutorial in my signature and work through it slowly and carefully. If you don't understand that then you've got big problems because that's a pretty good tutorial.
-
Sep 21st, 2006, 05:22 AM
#4
Fanatic Member
Re: Data passing between mdi child forms
Thats great explaination JM.Im going through that link properly this time if Ive missed out the mdi child part
Godwin
Help someone else with what someone helped you! 
-
Sep 26th, 2006, 04:10 AM
#5
Thread Starter
Lively Member
Re: Data passing between mdi child forms
great tutorial! thanks guys. in fact it solved my problem right away.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|