473,397 Members | 1,961 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,397 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 1439
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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,...
0
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...

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.