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

A Form won't close

Hello everyone,

I have main application form (child of System.Windows.Forms.Form) that
hosts quite a number of different visual components. Some time after
working with those components, the form refuses to be closed - I click
menu item that invokes Form.Close() method, I click 'close' icon on
the caption of the window (form) - nothing happens. No event comes to
Form_Closing(Object, CancelEventArgs) method either.

I'm at a loss how to even start debugging this situation and I would
appreciate any suggestions.

Thank you for your time,
Yuriy ZUbarev
Nov 15 '05 #1
2 2453
Hi Yuriy,

Known issue when you juggle with dynamically created controls. You should
call OnControlRemoved method on the ultimate control's container just after
you've removed the control from the container's Controls collection. This
method is protected as far as I remember, so if you use Panels, you should
probably create a container control inherited from the Panel.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Yuriy Zubarev" <yu***********@yahoo.ca> wrote in message
news:3f**************@shawnews.vc.shawcable.net...
Hello everyone,

I have main application form (child of System.Windows.Forms.Form) that
hosts quite a number of different visual components. Some time after
working with those components, the form refuses to be closed - I click
menu item that invokes Form.Close() method, I click 'close' icon on
the caption of the window (form) - nothing happens. No event comes to
Form_Closing(Object, CancelEventArgs) method either.

I'm at a loss how to even start debugging this situation and I would
appreciate any suggestions.

Thank you for your time,
Yuriy ZUbarev


Nov 15 '05 #2
If you set these up using the form properties events options check that
these havent been reset.
I have had it a couple of times that the event handlers get reset so that no
function is then called as a result of control being actioned.

"Yuriy Zubarev" <yu***********@yahoo.ca> wrote in message
news:3f**************@shawnews.vc.shawcable.net...
Hello everyone,

I have main application form (child of System.Windows.Forms.Form) that
hosts quite a number of different visual components. Some time after
working with those components, the form refuses to be closed - I click
menu item that invokes Form.Close() method, I click 'close' icon on
the caption of the window (form) - nothing happens. No event comes to
Form_Closing(Object, CancelEventArgs) method either.

I'm at a loss how to even start debugging this situation and I would
appreciate any suggestions.

Thank you for your time,
Yuriy ZUbarev

Nov 15 '05 #3

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

Similar topics

19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
9
by: Susan Bricker | last post by:
I am currently using the OnDirty event of a Form to detect whether any fields have been modified. I set a boolean variable. Then, if the Close button is clicked before the Save button, I can put...
6
by: Tom | last post by:
Is there ANY easy way to close a MDI Child form in the middle of it's load? For instance, during the Load event I find a need to close the form (for whatever reason - maybe the user isn't ready for...
7
by: Boni | last post by:
Dear all, if I do myform.close() is it disposed or not? is it correct do following? myForm.close() Info=SomeControlOntheForm.text This seems to work. But am not sure that it is waterproof....
5
by: AP | last post by:
IS there a way to run a procedure if the users close access directly rather than closing a menu screen that I have built? There is an event that works on close for this form, but it doesnt seem to...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get the value of a form control? -----------------------------------------------------------------------...
4
by: Jimmy | last post by:
Quick question for you. I'm using a small form for users to input a range of dates for a report (similar to the date range forms used in MS templates) that has an ok and a cancel button. How can I...
11
by: Zytan | last post by:
I have created a new form from the main form. When I close the main form with the 'x' close button, its Form.FormClosed event is run, but not the dialog's. Is this normal? It is ok /...
19
by: rbrowning1958 | last post by:
Hello, I am confused by dispose etc. and hope someone can set me right. 1. The Dispose(Bool) the IDE generates for a form has nothing to do with IDisposable, right? 2. So when is this called?...
5
by: Neil | last post by:
"lyle" <lyle.fairfield@gmail.comwrote in message news:48c3dde7-07bd-48b8-91c3-e157b703f92b@f3g2000hsg.googlegroups.com... Question for you. I'm doing something similar, only, instead of opening...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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.