473,395 Members | 1,996 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.

Return of Control from a Child form

hi,
I have an application with a MainForm(Parent) and SubForm(Child).
on click of a button the Child form is created. Iam not sure where in
the MainForm,the control is returned when i close the child form.

I need to know this to populate some values in a list box in the
Main form, which were got from the Child form. Is there any other way
to access a control in the Main form from the Child form.

Thanks
sendhil
Nov 22 '05 #1
2 1561
i can answer with respect to MFC. when u create a dialog(or form) from other
dialog(or form), parent is set.. so from the child dialog u can always do
PostMessage to its parent with the lParam u want to...

"Sendhil" <se***************@yahoo.com> wrote in message
news:aa*************************@posting.google.co m...
hi,
I have an application with a MainForm(Parent) and SubForm(Child).
on click of a button the Child form is created. Iam not sure where in
the MainForm,the control is returned when i close the child form.

I need to know this to populate some values in a list box in the
Main form, which were got from the Child form. Is there any other way
to access a control in the Main form from the Child form.

Thanks
sendhil

Nov 22 '05 #2
On 5 Aug 2004 13:38:16 -0700, Sendhil wrote:
on click of a button the Child form is created. Iam not sure where in
the MainForm,the control is returned when i close the child form.


It partially depends on how the Child form is displayed. If you display
the child form using the ShowDialog method, then when the child is closed,
control is returned to the statement immediately following the ShowDialog.

If you use the Show method, then the parent form continues without waiting
for the Child form to close. In this case, the best method would be to
pass a reference to the parent into the child so that the child could
access properties of the parent.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 22 '05 #3

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

Similar topics

2
by: Sendhil | last post by:
hi, I have an application with a MainForm(Parent) and SubForm(Child). on click of a button the Child form is created. Iam not sure where in the MainForm,the control is returned when i close the...
0
by: Steve McLellan | last post by:
Hi, I have an MDI application. Child forms have control boxes with min/max/restore buttons. As well as using the MDIList menu property to choose between forms, I have a representation of the...
3
by: Not Me | last post by:
Hi, Just trying to get my head around tab controls, is there anywhere which would describe the structure of how they work? I seem to be ok so far, being able to check which page I'm on etc......
2
by: Karl | last post by:
Hi, I'm just writing my first real c# application and I have a problem when trying to access a control in a child form. I am using an MDI application with a parent form called frmMain. In...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
1
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for...
5
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
9
by: Alexander Widera | last post by:
hi, is it possible to return an object of an unknown (but not really unknown) type with an method? i have the following situation: - a variable (A) of the type "object" which contains the...
5
by: Peted | last post by:
Just some threading questions 1. in a MDI app if you have multiple child forms, does each child form run in its own thread ? Eg do you get error trying to update one control on form1 from...
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
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...
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.