Hi

If i create a Brush object I believe it is good practice to explicitly
dispose it or use it within a using block.

Is it correct to assume that this does not apply to brushes from the
SystemBrushes collection?

Adam

Re: disposing of SystemBrushes by hirf-spam-me-here

hirf-spam-me-here
Thu Sep 02 20:25:46 CDT 2004

* =?Utf-8?B?YWRhbUB0d3Yub3Jn?= <adamtwvorg@discussions.microsoft.com> scripsit:
> If i create a Brush object I believe it is good practice to explicitly
> dispose it or use it within a using block.
>
> Is it correct to assume that this does not apply to brushes from the
> SystemBrushes collection?

That's correct.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Re: disposing of SystemBrushes by adamtwvorg

adamtwvorg
Fri Sep 03 04:03:05 CDT 2004

Thank you

Does this also apply to brushes from a named color as in:

graphics.fillPoloygon(Brushes.Black, .....

Adam

"Herfried K. Wagner [MVP]" wrote:

> * =?Utf-8?B?YWRhbUB0d3Yub3Jn?= <adamtwvorg@discussions.microsoft.com> scripsit:
> > If i create a Brush object I believe it is good practice to explicitly
> > dispose it or use it within a using block.
> >
> > Is it correct to assume that this does not apply to brushes from the
> > SystemBrushes collection?
>
> That's correct.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
>

Re: disposing of SystemBrushes by hirf-spam-me-here

hirf-spam-me-here
Fri Sep 03 07:16:36 CDT 2004

* =?Utf-8?B?YWRhbUB0d3Yub3Jn?= <adamtwvorg@discussions.microsoft.com> scripsit:
> Does this also apply to brushes from a named color as in:
>
> graphics.fillPoloygon(Brushes.Black, .....

Yes. You don't need to/should not dispose them.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>