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

Form Close Disposes?

When a form is closed, does it dispose? If not, how can I force that?
Trying to do a little memory management :-)

Derek
Nov 21 '05 #1
4 1438
On Fri, 12 Nov 2004 16:21:25 -0600, Derek Martin wrote:
When a form is closed, does it dispose? If not, how can I force that?
Trying to do a little memory management :-)

Derek


If you show the form using the Show method, it is automatically disposed
when you close it. If you show it using ShowDialog, it is NOT disposed and
you must dispose of it yourself.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #2
On Fri, 12 Nov 2004 16:21:25 -0600, Derek Martin wrote:
When a form is closed, does it dispose? If not, how can I force that?
Trying to do a little memory management :-)

Derek


If you show the form using the Show method, it is automatically disposed
when you close it. If you show it using ShowDialog, it is NOT disposed and
you must dispose of it yourself.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #3
Awesome - thank you!
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:1t******************************@40tude.net.. .
On Fri, 12 Nov 2004 16:21:25 -0600, Derek Martin wrote:
When a form is closed, does it dispose? If not, how can I force that?
Trying to do a little memory management :-)

Derek


If you show the form using the Show method, it is automatically disposed
when you close it. If you show it using ShowDialog, it is NOT disposed
and
you must dispose of it yourself.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.

Nov 21 '05 #4
Awesome - thank you!
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:1t******************************@40tude.net.. .
On Fri, 12 Nov 2004 16:21:25 -0600, Derek Martin wrote:
When a form is closed, does it dispose? If not, how can I force that?
Trying to do a little memory management :-)

Derek


If you show the form using the Show method, it is automatically disposed
when you close it. If you show it using ShowDialog, it is NOT disposed
and
you must dispose of it yourself.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.

Nov 21 '05 #5

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

Similar topics

4
by: Tonya | last post by:
Hi, Does anyone have any example of how i can manage forms in my application?? I want to be able to reference my form instances that are currently open from other forms. why cant i open...
5
by: Ranier Dunno | last post by:
Hi, I'm writing a data layer, and would like all components to have a single place for retrieving a connection to the (SQL Server) database. Currently, I'm treating the connection as somewhat...
9
by: Ale K. | last post by:
What's the best way to make a form return a value.... i want to try to avoid using module variables for doing this... Thanks. Alex.
7
by: spebola | last post by:
I am using VB.Net 2003 professional edition, and .Net Framework 1.1, and Windows forms. What is the proper way to close a windows form displayed by the Show method? I would like it to be removed...
35
by: Eric Sabine | last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET connection object, SQLConnection to be exact) and then I came across the following in some microsoft code. If Not cn Is Nothing...
0
by: Derek Martin | last post by:
When a form is closed, does it dispose? If not, how can I force that? Trying to do a little memory management :-) Derek
18
by: Jan Nielsen | last post by:
Hi I have a main form showing personal information (name, address etc.) bound to a dataset. One of the pieces of information is the Group the person belongs to. This is selected from a combo box....
5
by: Michael.Suarez | last post by:
Suppose I have a button on a form that opens up another form. the code in the buttons click event is: frmMyCustomForm frm = new frmMyCustomForm (); frm.ShowDialog(); frm.Dispose(); The...
3
by: =?Utf-8?B?UmljaCBIdXRjaGlucw==?= | last post by:
I have a form, Form1, that shows an instance of Form2 when a user clicks a button. On Form2, the user is to select items, Customer Names for example, from a datagrid control. When the user clicks a...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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,...
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...

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.