473,395 Members | 2,423 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.

passing data child parent parent child

hi,
how can i pass data from a parrentform to a childform and reverse
or retreave data from a childform of the parentform and reverse.

Regards Maarten
Nov 20 '05 #1
3 3207
A form is generated from a class. So simply add public or internal
properties to the child form class to pass data to it from the parent form.

Simply instantiate the child form class, set the properties, and then show
the form.

Pete
"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
hi,
how can i pass data from a parrentform to a childform and reverse
or retreave data from a childform of the parentform and reverse.

Regards Maarten

Nov 20 '05 #2
Dearest Maarten,
how can i pass data from a parrentform to a childform and reverse
or retreave data from a childform of the parentform and reverse.


Passing down variables to child forms or retrieving data from them is
very easy. While you're creating a new form, you're allowed to set a
different constructor - i.e. you can specify your own variables in the
form's constructor. This should allow you to pass down variables to
your child form while you're creating it.

To retrieve data from a parent form, simply declare a public variable
in the Parent form, and access it from the child form.

Heh, simple.

Nov 20 '05 #3
Thank's for the answers, they where not what i expected, but helped me much
more
than i expected.
i'm beginning to have a clear view on object orientated programmaing.

now i'm facing an other problem.
here is my code:

on a parrentform:

using UCAnalog;

namespace frmsettings
{
public class settings : System.Windows.Forms.Form
{
private void button2_Click(object sender, System.EventArgs e)

{

Analog an = new Analog();

an.listsetup();

this.Close();

}

}

}

on a usecontrol ;
namespace UCAnalog

{

public class Analog: System.Windows.Forms.UserControl

{

public void listsetup()

{

MessageBox.Show(test");

lstout.Items.Add ("Channel ",false);

}

}

}

I know the function listsetup in the class analog is called because the
messagebox gets activated.
but the item won't add in the checkedlistbox.

hope someone can help me.

greets Maarten.

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
hi,
how can i pass data from a parrentform to a childform and reverse
or retreave data from a childform of the parentform and reverse.

Regards Maarten

Nov 21 '05 #4

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

Similar topics

11
by: Mike M | last post by:
Is it possible? In the parent process, I have a socket that binds, listens and then accepts new connections (which creates new sockets in the process). I want to be able to pass some of these new...
4
by: John MacIntyre | last post by:
Hi, I have a page with a series of child pages loaded into an iframe. When I move from page to page, I store an object containing the child's control data in a variable on the main page, then...
1
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML...
2
by: Curtis Justus | last post by:
Hi, I currently have a control that is on a form and I want to pass that exact instance of the control to another form (a child form that appears on a button click). The control has state,...
1
by: mark | last post by:
I have a main form, and i have another form i need to call on a button press, then id like the result of the child form to pass data back to the parent - without losing any data previously entered...
5
by: Stephen Travis | last post by:
I'm trying to ReDim a child object after passing the parent object as System.Object and it throws a System.InvalidCastException: Cast from type 'Object()' to type 'ChildType()' is not valid. If I...
5
by: Swinky | last post by:
I have a form "AccountInfo" that contains company names. I have inserted a subform "Contacts" with contact names and have established parent/child relationships between the two forms. All works...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
4
by: John Sheppard | last post by:
Hello there I was wondering if anyone could help me, I am trying to pass a typed dataset to a dialoged child form by reference. I have binding sources sitting on the child form. So to refresh...
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: 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:
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.