Help Regarding panel.Hide
-
Hi all, I have alomost 20 pannels but on the form load i have to dispay upto 3, depending on the parameter, so here what am trying to do ... i am creating a form having all the pannels and during runtime on form load am hiding rest of the pannel apart from which one need to show, but its dosent looks good coz of space.. so my question is 1.How can i remove the space i tried with panel1.Size=new system.Drawing(200,300) but not able to locate properly.. 2.can it be done by anyother ways ? Thank you very much
vikas da
-
Hi all, I have alomost 20 pannels but on the form load i have to dispay upto 3, depending on the parameter, so here what am trying to do ... i am creating a form having all the pannels and during runtime on form load am hiding rest of the pannel apart from which one need to show, but its dosent looks good coz of space.. so my question is 1.How can i remove the space i tried with panel1.Size=new system.Drawing(200,300) but not able to locate properly.. 2.can it be done by anyother ways ? Thank you very much
vikas da
> 1.but not able to locate properly Control.Location, Control.Size and Control.Bounds are your friends... >2.can it be done by anyother ways hu.. what kind of way?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
> 1.but not able to locate properly Control.Location, Control.Size and Control.Bounds are your friends... >2.can it be done by anyother ways hu.. what kind of way?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
Super Lloyd wrote:
hu.. what kind of way?
like if we have no of pannels somewhere else .. since we are knowing the names of all the pannels so at run time if can add the required pannel .. am asking coz if i am saying pannel.hide or setting its visibility as false it will still use memory ...so why should we keep something that is not usefull ...so can you help me here .... Thank you very much for your reply :)
vikas da
-
Super Lloyd wrote:
hu.. what kind of way?
like if we have no of pannels somewhere else .. since we are knowing the names of all the pannels so at run time if can add the required pannel .. am asking coz if i am saying pannel.hide or setting its visibility as false it will still use memory ...so why should we keep something that is not usefull ...so can you help me here .... Thank you very much for your reply :)
vikas da
I do suggest using Hide()/Show() instead of destroying/creating the panels. For some reason destroying/creating the panel takes a noticeable amount of time, and can really drag the application down if you have many of them. On the other hand your panels probably don't use that much memory and show()/hide() is quite fast. Anway, good luck!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
I do suggest using Hide()/Show() instead of destroying/creating the panels. For some reason destroying/creating the panel takes a noticeable amount of time, and can really drag the application down if you have many of them. On the other hand your panels probably don't use that much memory and show()/hide() is quite fast. Anway, good luck!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
Super Lloyd wrote:
hu.. what kind of way?
like if we have no of pannels somewhere else .. since we are knowing the names of all the pannels so at run time if can add the required pannel .. am asking coz if i am saying pannel.hide or setting its visibility as false it will still use memory ...so why should we keep something that is not usefull ...so can you help me here .... Thank you very much for your reply :)
vikas da
-
You can create panels at runtime and add to the form's Controls collection. That's what the code created by the form designer does.
Despite everything, the person most likely to be fooling you next is yourself.
-
Hi all, I have alomost 20 pannels but on the form load i have to dispay upto 3, depending on the parameter, so here what am trying to do ... i am creating a form having all the pannels and during runtime on form load am hiding rest of the pannel apart from which one need to show, but its dosent looks good coz of space.. so my question is 1.How can i remove the space i tried with panel1.Size=new system.Drawing(200,300) but not able to locate properly.. 2.can it be done by anyother ways ? Thank you very much
vikas da
-
Why dont you just dock the panels properly & then set the visible to true or false based on your parameter. If all the panels are docked properly setting the visibility will do the trick for you