panels are nice but working with them is a pain when im changing their visibility modes.can anyone suggest a better option that will work like a panel but i can work with better ease?
Printable View
panels are nice but working with them is a pain when im changing their visibility modes.can anyone suggest a better option that will work like a panel but i can work with better ease?
Changin the visibilty of the panels is pretty simple, not sure what problem you may be having but it is hard to find something eaiser than visible=true or visible=false
there is not a general rule, and your sentence is a bit too general:
do you mean at runtime you do not get the right visual things you would?Quote:
working with them is a pain when im changing their visibility modes
do you mean you have too much stuff and you lose correct z-order?
In any case,if matter is at runtime, you could try using a FlowLayoutPanel (with autoscroll = true) as the general container inside a form (or a tab of a TabControl if you need more than one) Every thing you put in a flowLayoutPanel will arrange itself while invisible elemenst apparently disappears.
Better, however, keep together things that should appear or disapper as one thing in a ....panel or groupbox container.
sorry for being so naive, i meant when i try to put a panel on top of another panel,the panel at the back becomes invisible because of overlapping.my intention is to put a set of controls like textbox,buttons etc on one container,then have another set on another container.then when i push a button, container1 will become visible.same thing will happen after i push another button,but this time container1 will become hidden and container2 will come to sight.
all i can think of is this
or vice versa.but its not worthy.i am thinking of another type of container but couldnt manage to find any.am i clear now?Code:panel1.visible=false;
panle2.visible=true;
That would work fine the thing you need to be aware of is that if you try to put one panel over another in the IDE there is a good chance that the panel will go inside the existing panel and your method will fail.
The way I normally handle this is to place one of the panels where I actually want it, then place the others at different locations so as to be able to see and work with them at design time even if it means making the form very large in the ide. At runtime I will set the form size to what i actually want it to be if needed and set all the panel locations=the panel I placed where I wanted them. Then it is just a matter of toggling the visible property on the various panels as needed.
try flowlayoutpanel
or
TabControl