473,379 Members | 1,511 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,379 software developers and data experts.

Close button on MDI parent

When user click on the "x" close button on the MDI parent form, how can I set
an event handler on it? I want to save some settings before the form is
closed. Some forum mentions associate it with the cancel button, there is no
button here.

Anthony.
Oct 15 '07 #1
3 2519
Anthony,

Have you looked into the FormClosing event on the parent form? That
should fire when the X button is clicked.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ATT" <AT*@discussions.microsoft.comwrote in message
news:9C**********************************@microsof t.com...
When user click on the "x" close button on the MDI parent form, how can I
set
an event handler on it? I want to save some settings before the form is
closed. Some forum mentions associate it with the cancel button, there is
no
button here.

Anthony.

Oct 15 '07 #2
On 15 Oct, 16:53, ATT <A...@discussions.microsoft.comwrote:
When user click on the "x" close button on the MDI parent form, how can I set
an event handler on it? I want to save some settings before the form is
closed. Some forum mentions associate it with the cancel button, there is no
button here.

Anthony.
Nicholas' post will solve your problem, but you might also want to
look into the OnClosed method of Form. If you override OnClosed in
your own form, you will receive a CloseReason (which will be
CloseReason.MdiFormClosing if your MdiParent is closing).

Alun Harford

Oct 16 '07 #3
Nicholas, Alun, thanks.

I got it to work now. Anthony.

"alunharford" wrote:
On 15 Oct, 16:53, ATT <A...@discussions.microsoft.comwrote:
When user click on the "x" close button on the MDI parent form, how can I set
an event handler on it? I want to save some settings before the form is
closed. Some forum mentions associate it with the cancel button, there is no
button here.

Anthony.

Nicholas' post will solve your problem, but you might also want to
look into the OnClosed method of Form. If you override OnClosed in
your own form, you will receive a CloseReason (which will be
CloseReason.MdiFormClosing if your MdiParent is closing).

Alun Harford

Oct 17 '07 #4

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

Similar topics

28
by: PerryC | last post by:
Anyone know how to auto close the parent / opener window without confirmation? I have tried: <script> opener.window.close() </script> ----I put it in the child html page, and nothing...
1
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...
5
by: Nick250 | last post by:
I have a simple app that I created for our Real Estate office using Access 2000 and it is working fine except for on thing. I need to keep the close button hidden from the users. No problem...
13
by: lightzizo | last post by:
All, How can I disable or remove the close button in the screen. thanks
2
by: VBLearner | last post by:
How to close the parent and all child forms together at once when click on parent window's close button X?
4
by: sajit | last post by:
hi folks, I am curently working in vb.net 2005. I am stuck at one technical glitch. How to open another form and close the parent foem in vb.net. I have tried every thing like me.close as well...
8
by: karthickchain | last post by:
i am developing window application,i have to forms namely form1,form2. if i click the button in form1,the frm1 have to close and form2 to display i used form1.close(),and parent.close nothing is...
3
by: Roger Davis | last post by:
Hi, I am brand-new to Python but am an experienced C/Unix programmer. I am rewriting in Python some old shell scripts that do lots of stuff like set output = `cat this | grep that | whatever...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...

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.