473,666 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can MDI be motified when child closes

I need a MDI form to be notified when one of it's child closes.

I could define an event in each child and raise it when it closes.

But if there is some WinProc message that occurs when a child closes I would
rather use it and automate the process.
Second question. When a form Closed event occurs is the form then disposed.
I want to check the variable that references the form and if the form is
closed do a 'New"
So I'll check to see if it's disposed - right?

thanks
Nov 20 '05 #1
1 1418
* " SamSpade" <st************ **@REMOVEaol.co m> scripsit:
I need a MDI form to be notified when one of it's child closes.

I could define an event in each child and raise it when it closes.
\\\
Private m_Child As Form2

Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArg s _
) Handles Button1.Click
If m_Child Is Nothing Then
m_Child = New Form2()
m_Child .MdiParent = Me
AddHandler m_Child.Load, AddressOf Me.MdiChild_Loa d
AddHandler m_Child.Closed, AddressOf Me.MdiChild_Clo sed
End If
m_Child.Show() ' ...
End Sub

Private Sub MdiChild_Load( _
ByVal sender As System.Object, _
ByVal e As System.EventArg s _
)
MsgBox( _
"MdiChild with handle " & _
DirectCast(send er, Form).Handle.To String() & _
" loaded!" _
)
End Sub

Private Sub MdiChild_Closed ( _
ByVal sender As Object, _
ByVal e As System.EventArg s _
)
MsgBox( _
"MdiChild with handle " & _
DirectCast(send er, Form).Handle.To String() & _
" closed!" _
)
End Sub
///
Second question. When a form Closed event occurs is the form then disposed.
I want to check the variable that references the form and if the form is
closed do a 'New"
So I'll check to see if it's disposed - right?


\\\
If <...>.IsDispose d Then
...
End If
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

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

Similar topics

4
2894
by: jrefactors | last post by:
>From the main page, there are lots of links to open new window. i.e. <a href="#" onClick="window.open('child1.html')">Open Child Window</a> If I close the main page, I want to close all child windows also. That means I need to keep track all handles of the child windows whenever I open a new window. Correct? any suggestions on the approach? Please advise. thanks!!
1
3368
by: gopal srinivasan | last post by:
I need to know how to close a parent modal window when child modal window opens, also i need to know the syntax for writing document on the modal window on the fly, like what we do in case of normal window. Actually, I tried to close the parent window from the child modal window using parent.close syntax in onload event in child modal window. It actually closes the parent modal window, but the child modal window is not opened, why it is...
2
2437
by: John Dalberg | last post by:
I have a closed box system which opens an html page. The page closes by the system. I have access to the html page. I added code to open a child window from this page. However when the parent window closes, the child closes too. Is there a way to keep the child window open? Yes keep it orphaned. -- John Dalberg
1
3422
by: Samy | last post by:
Hi There, I have a child window opened from aspx page using window.open. On the child window, I have a button(New category) which opens a grandchild. I also have a cancel button on the child window which when clicked should close the child and the granchild windows. Can anybody suggest me how this can be accomplished. I am using image buttons to do this. This is how I am implementing, but for some reason the 'win' is undefined.
2
2901
by: Paul | last post by:
Hi this is related to a previous post, hopefully just a bit clearer description o the problem. I have a parent form that opens a new form (child form) while still leaving the parent form open. Although the child form has a close button (with java script) if the user navigates the parent form to another form the child form is still open. Just wondering if there is a way to close the child form when the user navigates away with the parent...
10
7138
by: SStory | last post by:
How can the MDI parent form know when an MDI child closes? I need to know when the last one closes because I have something on the MDI form that I need to clear out when all children are closed... Thanks, Shane
1
1484
by: devenderraopalleni | last post by:
can any one plz throw some light on my problem : i want to know how to automatically update the parent window when closes the child window
1
4077
by: mia888 | last post by:
Hi All Any help will be much appreciated... Not sure if this is possible but i'll ask the question anyway... I have a parent window which opens a child window. However, upon closing I would like to pass the value from the child window to the parent window... I know that you can use: window.opener.<parent window>.value = watever in the child window... But I want the parent window to get the value from the child window rather than...
4
1888
by: sreemathy2000 | last post by:
I have a vague problem.. Inmy windows application in c#, i'm opening a child window from from my main window thru the show method. I have few events on the child window. After my button click event on the child window, it closes and control comes back to the main window. not sure why the child window is closing. please let me know if anybody has faced this problem.
0
8363
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,...
0
8787
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8561
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
8645
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...
0
7389
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6203
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
5672
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
4200
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...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.