473,769 Members | 4,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2488
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
490
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 to parent container control as the child is created by an intermediary class that doesnt keep parent's handle or reference. regards, anony
2
5202
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 be dragged. on the mouse down event of my control i want to pass the size of the control and the location to the parent so that i can draw a selection box around it.
2
4086
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 Invoke(new EventHandler(AddressOf thisFunc), new Object() { sender, e}) Return End If
2
2352
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 usercontrol Parent usercontol has one button to change the child usercontorl's variable.
0
2427
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 order to be able to move that Form around with the mouse I have to implement EventHandlers for the MouseDown, MouseUp and MouseMove event. Now the problem I have is these Events will never be fired because the entire dialog is covered by the...
0
1256
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 controls. In this Usercontrol a panel is there, which is a parent control for all reamaining controls. In this panel, a splitter control is there, in this splitter control left side i have another panel. In order to resize the controls based on the...
2
13297
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 example which hopefully shows my problem. Regards Martin
5
2184
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 don't want to go through the hassle of creating events in the user control, and then let the parent handle the event. What is the easiest way to find a control in the parent page? Right now, I am simply manually traversing it from the user...
0
883
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 ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:GridView ID="gvtitles" runat="server" CssClass="wtable" AutoGenerateColumns="False" OnRowDeleting="gvDeleteItem" OnRowCancelingEdit="gvCancel"...
2
1689
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 in its place. I am not sure how to do this from within a control itself. Can anyone offer any help and show me what I am doing wrong with my code below? //This is on one of my controls. protected void btnSubmit_Click(object sender, EventArgs e)...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9994
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.