473,473 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Status of Dispose()'d Form

In this tiny program I address a Disposed() Form object. I expect an
exeption but don't get one. What is the status of a Disposed() Control?

using System;
using System.Windows.Forms;
class Class
{
static void Main()
{
Form form=new Form();
form.Text="Make a jazz noise here";
Console.WriteLine("form status = {0}",form);
form.Dispose();
Console.WriteLine("form status = {0}",form);
}
}

_______________________
Output:

form status = System.Windows.Forms.Form, Text: Make a jazz noise here
form status = System.Windows.Forms.Form, Text: Make a jazz noise here

Sep 28 '07 #1
1 1197
Disposing a form only frees up unmanaged memory; it does not de-reference
the class.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Martijn Mulder" <i@mwrote in message
news:46***********************@news.wanadoo.nl...
In this tiny program I address a Disposed() Form object. I expect an
exeption but don't get one. What is the status of a Disposed() Control?

using System;
using System.Windows.Forms;
class Class
{
static void Main()
{
Form form=new Form();
form.Text="Make a jazz noise here";
Console.WriteLine("form status = {0}",form);
form.Dispose();
Console.WriteLine("form status = {0}",form);
}
}

_______________________
Output:

form status = System.Windows.Forms.Form, Text: Make a jazz noise here
form status = System.Windows.Forms.Form, Text: Make a jazz noise here

Sep 28 '07 #2

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

Similar topics

3
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
6
by: R. Rajesh Jeba Anbiah | last post by:
Is it necessary or is there any standard to send HTTP header status for form inputs ? Say, the user is entering invalid password in login form and now all the applications I have seen are just...
9
by: David Sworder | last post by:
Hi, I have a form that displays data (is that vague enough for you?). The data comes in on a thread-pool thread. Since the thread pool thread is not the same as the UI thread, the callback...
6
by: nadeem_far | last post by:
Hello All, I am working on a .Net desktop application and I am having problem displaying a form. I am using C# and version 1.1 of the framework. here is how the code looks likes and I will...
0
by: MilanB | last post by:
Hello There is a form2 with events that are called from form1. Example form2.textBox1.Text = this.textBox1.Text; Even when I explicitly dispose form2 with form2.Dispose(), it's event:...
2
by: devine | last post by:
Hi All, I am trying to send an automatic email when an update has been made. My update statement will updates 6 fields, and dependant on one of the fields, I would like to send an email using CDO....
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?...
2
by: BillE | last post by:
Using vb.net 2008 windows forms. How can a form which has been closed and disposed still attempt to handle a custom event? I have a form which inherits from a base form class. The base...
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
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.