Click here to Skip to main content
15,917,862 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: ComboBox issues Pin
Luc Pattyn17-Oct-07 3:13
sitebuilderLuc Pattyn17-Oct-07 3:13 
GeneralRe: ComboBox issues Pin
tuga-x17-Oct-07 3:45
tuga-x17-Oct-07 3:45 
GeneralRe: ComboBox issues Pin
Luc Pattyn17-Oct-07 14:53
sitebuilderLuc Pattyn17-Oct-07 14:53 
GeneralRe: ComboBox issues Pin
tuga-x17-Oct-07 23:02
tuga-x17-Oct-07 23:02 
GeneralRe: ComboBox issues Pin
Luc Pattyn18-Oct-07 2:52
sitebuilderLuc Pattyn18-Oct-07 2:52 
GeneralRe: ComboBox issues Pin
tuga-x18-Oct-07 2:57
tuga-x18-Oct-07 2:57 
GeneralRe: ComboBox issues Pin
Patrick Etc.18-Oct-07 9:16
Patrick Etc.18-Oct-07 9:16 
GeneralRe: ComboBox issues Pin
Luc Pattyn18-Oct-07 9:42
sitebuilderLuc Pattyn18-Oct-07 9:42 
Hi Patrick,

I do agree with most of what you said.
I did not like the Dispose() calls either, but then the little mystery was the
combobox stopped, then resumed, getting events fired, and it was never disposed.
So while I did not like the code, I could not explain its behavior.

But what triggered me to react now was your statement: "Dispose() is one of those functions
that should almost never need to be explicitly used".

Well I have gotten the advice, and have been repeating it over and over, to "call
Dispose on instances you no longer need whenever the class offers Dispose()"; the rationale
is you don't know whether any unmanaged resources are being used (and how big the
managed ones could be), so it is best practice to call Dispose() when you're done with
an object. This is quite the opposite of what you write though. Care to elaborate?


[Added] I typically don't call dispose on controls, except for forms/dialogs, since
my controls tend to always be part of some Form, and I trust .NET to dispose properly
of the Controls that are used on a Form that gets Closed or Disposed.[/added]

Smile | :)



Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google


GeneralRe: ComboBox issues Pin
Patrick Etc.18-Oct-07 9:56
Patrick Etc.18-Oct-07 9:56 
GeneralRe: ComboBox issues Pin
Luc Pattyn18-Oct-07 10:41
sitebuilderLuc Pattyn18-Oct-07 10:41 
GeneralRe: ComboBox issues Pin
tuga-x18-Oct-07 22:19
tuga-x18-Oct-07 22:19 
QuestionValueType vs Reference Pin
rtalan17-Oct-07 0:16
rtalan17-Oct-07 0:16 
AnswerRe: ValueType vs Reference Pin
Robert Rohde17-Oct-07 0:27
Robert Rohde17-Oct-07 0:27 
GeneralRe: ValueType vs Reference Pin
rtalan17-Oct-07 0:48
rtalan17-Oct-07 0:48 
GeneralRe: ValueType vs Reference Pin
lmoelleb17-Oct-07 1:39
lmoelleb17-Oct-07 1:39 
GeneralRe: ValueType vs Reference Pin
rtalan17-Oct-07 1:53
rtalan17-Oct-07 1:53 
GeneralRe: ValueType vs Reference Pin
lmoelleb17-Oct-07 2:12
lmoelleb17-Oct-07 2:12 
GeneralRe: ValueType vs Reference Pin
rtalan17-Oct-07 2:42
rtalan17-Oct-07 2:42 
GeneralRe: ValueType vs Reference Pin
Luc Pattyn17-Oct-07 2:57
sitebuilderLuc Pattyn17-Oct-07 2:57 
GeneralRe: ValueType vs Reference Pin
rtalan17-Oct-07 3:31
rtalan17-Oct-07 3:31 
GeneralRe: ValueType vs Reference Pin
Luc Pattyn17-Oct-07 3:44
sitebuilderLuc Pattyn17-Oct-07 3:44 
GeneralRe: ValueType vs Reference Pin
lmoelleb17-Oct-07 4:46
lmoelleb17-Oct-07 4:46 
GeneralRe: ValueType vs Reference Pin
George L. Jackson17-Oct-07 12:24
George L. Jackson17-Oct-07 12:24 
GeneralRe: ValueType vs Reference Pin
DavidNohejl17-Oct-07 23:21
DavidNohejl17-Oct-07 23:21 
Questionhow to use Indesign files in asp.net Pin
gopal_Pandey16-Oct-07 18:56
gopal_Pandey16-Oct-07 18:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.