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

Dispose in Forms (VS 2005)

Hi misters,

I noticed one thing that looked a little weird: The Dispose method goes into
the generated portion of the partial form.

Now, this might not be highly applicable to a Form (because you should be
putting resource control code in another class etc), but what if, for
whatever reason, you needed to put some code into the Dispose method?

Any suggestion about it ?

Thanks in advance, greetings.
--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft

Jul 22 '08 #1
5 1055
Maybe you can move the method from *.Designer.cs to your *.cs...

L

"Alhambra Eidos Kiquenet" <Al*******************@discussions.microsoft.com >
wrote in message news:E1**********************************@microsof t.com...
Hi misters,

I noticed one thing that looked a little weird: The Dispose method goes
into
the generated portion of the partial form.

Now, this might not be highly applicable to a Form (because you should be
putting resource control code in another class etc), but what if, for
whatever reason, you needed to put some code into the Dispose method?

Any suggestion about it ?

Thanks in advance, greetings.
--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft
Jul 22 '08 #2
Thanks mister,

is the unique solution about it ?

greetings
Jul 22 '08 #3
Hello,

I can't personally think of another...

What code are you putting in the dispose method anyhow?

L

"Alhambra Eidos Kiquenet" <Al*******************@discussions.microsoft.com >
wrote in message news:34**********************************@microsof t.com...
Thanks mister,

is the unique solution about it ?

greetings
Jul 22 '08 #4
You could subscribe to Dispose event or add a custom component (class that
implements IComponent) to the form and it will be notified when form is
being disposed.

"Alhambra Eidos Kiquenet" <Al*******************@discussions.microsoft.com >
wrote in message news:E1**********************************@microsof t.com...
Hi misters,

I noticed one thing that looked a little weird: The Dispose method goes
into
the generated portion of the partial form.

Now, this might not be highly applicable to a Form (because you should be
putting resource control code in another class etc), but what if, for
whatever reason, you needed to put some code into the Dispose method?

Any suggestion about it ?

Thanks in advance, greetings.
--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.net
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft

Jul 22 '08 #5
JS
I agree, Dispose should not be in the *.designer.cs code. However,
it's only touched by VS200* when you create the form. AFAIK you can
freely edit code inside Dispose and the designer won't have a problem
or delete your code.
Jul 23 '08 #6

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

Similar topics

4
by: Adriano Coser | last post by:
I'm getting the following error: error C3767: PictureSource - candidate function(s) not accessible when accessing a public member function of a managed class, either from managed or unmanaged...
3
by: Lance | last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI...
156
by: Dennis | last post by:
Ok, I'm trying to dispose of every object that I create that has a dispose method based on advice from this newsgroup. However, I'm not sure how to dispose of the following object that was created...
0
by: **Developer** | last post by:
Would someone pass this on to MS and/or check to see it the problem persists in 2005? I don't have 2005 and do not know how to pass it on. Nor do I have the time to spend learning how unless...
34
by: Bob | last post by:
Hi, The compiler gives Warning 96 Variable 'cmdSource' is used before it has been assigned a value. A null reference exception could result at runtime. Dim cmdSource as SQlClient.SQLDataReader...
9
by: Geoff Callaghan | last post by:
I have several functions that require doing a New on a local object. If the object is local to a sub or function, do I need to dispose of it, or will it just go away like any other local variable?...
13
by: Grafix | last post by:
All - As we all know, Dispose method is reserved in C++ 8 and the expected syntax is to use ~MyClass(). In 1.1, we used to have following structure for Dispose class MyClass : IDisposable {...
1
by: Dave Harry | last post by:
I've had trouble with VB 2003 not doing things quite right, help won't compile, etc, things are being a general pain the the bum. I've downloaded the VB Express 2005 and trying my code there...
8
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a...
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?...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.