473,324 Members | 2,531 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,324 software developers and data experts.

parent handle/control

Hello,
Does anybody know how to get window handle of parent window (the main
application window) in C#. I am trying to set mdiParent of a child window in
child's Load( ). I dont know how to set it to parent container control as
the child is created by an intermediary class that doesnt keep parent's
handle or reference.

regards,
anony
Nov 22 '05 #1
4 2459
In article <OU**************@TK2MSFTNGP11.phx.gbl>, Ayaz Ali wrote:
Hello,
Does anybody know how to get window handle of parent window (the main
application window) in C#. I am trying to set mdiParent of a child window in
child's Load( ). I dont know how to set it to parent container control as
the child is created by an intermediary class that doesnt keep parent's
handle or reference.

regards,
anony


Pass it through.

No, just create a class Pool (singleton) and get the value from there.

Otherwise you will have to traverse the tree of parents. I don't
know how realistic it is, because I favored one of the two approaches above.
Nov 22 '05 #2
In article <OU**************@TK2MSFTNGP11.phx.gbl>, Ayaz Ali wrote:
Hello,
Does anybody know how to get window handle of parent window (the main
application window) in C#. I am trying to set mdiParent of a child window in
child's Load( ). I dont know how to set it to parent container control as
the child is created by an intermediary class that doesnt keep parent's
handle or reference.

regards,
anony


Pass it through.

No, just create a class Pool (singleton) and get the value from there.

Otherwise you will have to traverse the tree of parents. I don't
know how realistic it is, because I favored one of the two approaches above.
Nov 22 '05 #3
In article <OU**************@TK2MSFTNGP11.phx.gbl>, Ayaz Ali wrote:
Hello,
Does anybody know how to get window handle of parent window (the main
application window) in C#. I am trying to set mdiParent of a child window in
child's Load( ). I dont know how to set it to parent container control as
the child is created by an intermediary class that doesnt keep parent's
handle or reference.

regards,
anony


Regex might be an overkill in this case.

String object can split its contents:

String[] fields = "a,b,c,d,ef,gh,ikl".Split(',');
Nov 22 '05 #4
In article <OU**************@TK2MSFTNGP11.phx.gbl>, Ayaz Ali wrote:
Hello,
Does anybody know how to get window handle of parent window (the main
application window) in C#. I am trying to set mdiParent of a child window in
child's Load( ). I dont know how to set it to parent container control as
the child is created by an intermediary class that doesnt keep parent's
handle or reference.

regards,
anony


Regex might be an overkill in this case.

String object can split its contents:

String[] fields = "a,b,c,d,ef,gh,ikl".Split(',');
Nov 22 '05 #5

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

Similar topics

4
by: Ayaz Ali | last post by:
Hello, Does anybody know how to get window handle of parent window (the main application window) in C#. I am trying to set mdiParent of a child window in child's Load( ). I dont know how to set it...
2
by: fragget | last post by:
hi- i have a custom control that can be dragged onto a form. the control can be dragged around the form with the mouse. i want to draw a selection box around my control when it is selected to...
2
by: Samuel R. Neff | last post by:
I'm trying to find a good way to handle Control.InvokeRequired without duplicating four lines of code in every function/event. Typically what I've seen in books is this: If InvokeRequired Then...
2
by: lotus | last post by:
HI All.. I'm realtively new to C#. I have MainForm which includes Parent usercontol, and this parent usercontrol also contains child usercontrol. MainForm --> Parent usercontrol --> child...
0
by: hmm | last post by:
Hi all I have two problems: Problem #1: I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In...
0
by: alwayssmiling | last post by:
Hi, In my application, In the main form tab control is there. For this im adding a tabpage which contains a user control, this usercontrol contains many windows controls and other userdefined...
2
by: Martin M. Pedersen | last post by:
Hi, I have a program where I read a lot of user data. How can I handle the case where the user press control-d ? Is it possible to disable control-d or re-open the cin ? I have made a small...
5
by: gnewsgroup | last post by:
In my user control, I would like to find a Label control in the parent page (the page that uses my user control). I need to update that Label.Text when something happens in the user control. I...
0
by: mentor | last post by:
The GridView in Cotent page cause an updating event, but the handling methond won't be executed. The Row Count of the GridView is Zero, but in fact it's not zero. Why? <asp:Content...
2
by: =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post by:
I have a web app that when I click a menu, I load a control. On one of these controls, I have a button that when clicked, I need to unload the control to unload itself and load a different control...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.