TabControl and Inheritance

  • Thread starter Thread starter scorpion53061
  • Start date Start date
S

scorpion53061

I am reusing the same controls in a large tab control. Should I be doing the
dispose statement or soemthing else to remove the items from memory? Or will
the framework know to destroy it when it needs to?
 
the framework dous this automaticly. If have problems w this (that would be
a big tab ;) ) you could dispose manually when you no longer need them, this
could free the resources a bit faster, don't expect big differences.
but that to the side i don't realy understand why you would want to do that
in a tab control?

eric
 
I am not using the dispose statement....

What I am trying to say is that when the user is switching between tabs and
code is instructing it to add certain controls are these controls being
added to the resources being used or is it pulling it from what is already
out there?

What I am tring to avoid is if the user clicks on 15 different tabs are they
going to have consumed resources for 15 "cancel" buttons (create 15
instances) or will it be using the same cancel button resource (only one
instance) it did when it began? If I need to manually dispose of the
"cancel" button instance between tab selection changes how would I do that?
 
I was using a technique to fill a datagrid with an arraylist that Tucker
taught me and I noticed that when the tab was reloaded their appeared to be
controls from other tabs or possibly the same tab page were present behind
the grid. I started checking to see if every button that was reused was not
being destroyed once it left the tab and was unsure so I thought I would
ask.

But if I know the framework will handle this well I wont worry about it.
 
its not impossible that there are some controls left behind other things.
but as long as your app is not acting up i wouldn't worry about it.
for more info you'll probably have to wait for tucker then.

(i know this isn't much help but it's the best i can do atm)

eric
 
Oh its no problem........I did some research on tab controls and inheritance
and didnt find a lot of material.

Your input is always cool.
 
Back
Top