Click here to Skip to main content
15,912,665 members
Home / Discussions / C#
   

C#

 
AnswerRe: Where Does VS Store Element Properties? Pin
AspDotNetDev27-May-10 17:24
protectorAspDotNetDev27-May-10 17:24 
GeneralRe: Where Does VS Store Element Properties? Pin
Roger Wright27-May-10 18:48
professionalRoger Wright27-May-10 18:48 
AnswerRe: Where Does VS Store Element Properties? Pin
Dr.Walt Fair, PE27-May-10 17:31
professionalDr.Walt Fair, PE27-May-10 17:31 
GeneralRe: Where Does VS Store Element Properties? Pin
Roger Wright27-May-10 18:50
professionalRoger Wright27-May-10 18:50 
AnswerRe: Where Does VS Store Element Properties? Pin
Luc Pattyn27-May-10 17:34
sitebuilderLuc Pattyn27-May-10 17:34 
GeneralRe: Where Does VS Store Element Properties? Pin
Roger Wright27-May-10 18:55
professionalRoger Wright27-May-10 18:55 
AnswerRe: Where Does VS Store Element Properties? Pin
Henry Minute28-May-10 1:18
Henry Minute28-May-10 1:18 
QuestionHow to implement a cleanup method for managed resource? Pin
jabbawok27-May-10 15:28
jabbawok27-May-10 15:28 
As far as I can work out, finalizers/Dispose methods are only used for unmanaged resources, correct?

Well I have this problem:
I have a class inherited from UserControl. The constructor creates a ToolStrip to be displayed on the control. When the control is no longer referenced it gets GC'd, and the ToolStrip should too.

However I noticed a memory leak with this and I found a thread on another forum explaining that a ToolStrip subscribes to the SystemEvents.UserPreferenceChanged event. This prevents the control from being GC'd since that event is referencing it. A way to fix this is to set the Visible property of the ToolStrip to false before the control has no references to it. This works.

But I want this to be done "automatically". So how do I write a "destructor" method that will set the Visible property when no references to the ToolStrip are left? I'm confused since this isn't really an unmanaged resource.
AnswerRe: How to implement a cleanup method for managed resource? Pin
Luc Pattyn27-May-10 16:20
sitebuilderLuc Pattyn27-May-10 16:20 
GeneralRe: How to implement a cleanup method for managed resource? Pin
hammerstein0528-May-10 0:53
hammerstein0528-May-10 0:53 
QuestionCreate a table in C# Pin
ASPnoob27-May-10 14:41
ASPnoob27-May-10 14:41 
AnswerRe: Create a table in C# Pin
Luc Pattyn27-May-10 14:57
sitebuilderLuc Pattyn27-May-10 14:57 
QuestionAdd product key to installation project Pin
Enobong Adahada27-May-10 7:11
Enobong Adahada27-May-10 7:11 
AnswerRe: Add product key to installation project Pin
optimus_prime127-May-10 7:43
optimus_prime127-May-10 7:43 
AnswerRe: Add product key to installation project Pin
Henry Minute27-May-10 12:42
Henry Minute27-May-10 12:42 
GeneralRe: Add product key to installation project Pin
Luc Pattyn27-May-10 12:52
sitebuilderLuc Pattyn27-May-10 12:52 
GeneralRe: Add product key to installation project Pin
Henry Minute27-May-10 12:54
Henry Minute27-May-10 12:54 
GeneralRe: Add product key to installation project Pin
Luc Pattyn27-May-10 13:02
sitebuilderLuc Pattyn27-May-10 13:02 
GeneralRe: Add product key to installation project Pin
Roger Wright27-May-10 15:55
professionalRoger Wright27-May-10 15:55 
GeneralRe: Add product key to installation project Pin
Luc Pattyn27-May-10 16:03
sitebuilderLuc Pattyn27-May-10 16:03 
GeneralRe: Add product key to installation project Pin
Henry Minute28-May-10 1:22
Henry Minute28-May-10 1:22 
GeneralRe: Add product key to installation project Pin
Luc Pattyn28-May-10 2:07
sitebuilderLuc Pattyn28-May-10 2:07 
QuestionEvent for the release of a menu item Pin
manustone27-May-10 5:08
manustone27-May-10 5:08 
AnswerRe: Event for the release of a menu item Pin
Luc Pattyn27-May-10 5:32
sitebuilderLuc Pattyn27-May-10 5:32 
GeneralRe: Event for the release of a menu item Pin
manustone27-May-10 21:50
manustone27-May-10 21:50 

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.