473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Panels

JJ
Hi All,

I have 2 panels that have controls on them in a win
form. On Init of app I hide panel2 and show panel1, no
problem. On button Click I hide panel 1 and show panel 2,
panel 1 disappears but no panel 2 with controls showing.

Any idea what I might be doing wrong ?

Thanks,

JJ
Nov 15 '05 #1
3 5289
I'd almost bet the bank that your Panel2 got added to the wrong parent
They should be both added to whatever parent control is appropriate, such
as:

this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);

You can check this with panel2.Parent in code or simply check in the
InitializeComponent method and inspect the Add methods to see where panel2
is being added. If it's being added to
this.panel1.Controls.Add(panel2);
then you'll never see it.

Chris R.

"JJ" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
Hi All,

I have 2 panels that have controls on them in a win
form. On Init of app I hide panel2 and show panel1, no
problem. On button Click I hide panel 1 and show panel 2,
panel 1 disappears but no panel 2 with controls showing.

Any idea what I might be doing wrong ?

Thanks,

JJ

Nov 15 '05 #2
I concur with Chris's analysis. Moreover, once you have fixed the problem,
be careful when using the form designer. It is really easy to resurect the
problem again and again. Trust me. :(

--Ken

"Chris R" <so*****@hotmail.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
I'd almost bet the bank that your Panel2 got added to the wrong parent
They should be both added to whatever parent control is appropriate, such
as:

this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);

You can check this with panel2.Parent in code or simply check in the
InitializeComponent method and inspect the Add methods to see where panel2
is being added. If it's being added to
this.panel1.Controls.Add(panel2);
then you'll never see it.

Chris R.

"JJ" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
Hi All,

I have 2 panels that have controls on them in a win
form. On Init of app I hide panel2 and show panel1, no
problem. On button Click I hide panel 1 and show panel 2,
panel 1 disappears but no panel 2 with controls showing.

Any idea what I might be doing wrong ?

Thanks,

JJ


Nov 15 '05 #3
JJ
Hi All, Chris,

I found this in the initialize component:
this.panel1.Controls.Add(this.panel2);
and have commented it out. It Works!
Also I noticed that the form designer put this in for the
panels:

this.panel1.SuspendLayout();
this.panel2.SuspendLayout();

What does this do?

P.S. By the way I had commented them out and put in your
code to get it to work right.

Thanks,
JJ
-----Original Message-----
I'd almost bet the bank that your Panel2 got added to the wrong parentThey should be both added to whatever parent control is appropriate, suchas:

this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);

You can check this with panel2.Parent in code or simply check in theInitializeComponent method and inspect the Add methods to see where panel2is being added. If it's being added to
this.panel1.Controls.Add(panel2);
then you'll never see it.

Chris R.

"JJ" <an*******@discussions.microsoft.com> wrote in messagenews:03****************************@phx.gbl...
Hi All,

I have 2 panels that have controls on them in a win form. On Init of app I hide panel2 and show panel1, no
problem. On button Click I hide panel 1 and show panel 2, panel 1 disappears but no panel 2 with controls showing.
Any idea what I might be doing wrong ?

Thanks,

JJ

.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PZ | last post by:
OSS 2005 The First International Conference on Open Source Systems Genova, July 11 - 15, 2005 CALL FOR PANELS http://oss2005.case.unibz.it Submissions of panels are solicited for the "First...
0
by: PZ | last post by:
OSS 2005 The First International Conference on Open Source Systems Genova, July 11 - 15, 2005 CALL FOR PANELS http://oss2005.case.unibz.it Submissions of panels are solicited for the "First...
4
by: BBM | last post by:
I'm trying to set up a form with two panels divided by a Splitter control. I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to...
1
by: pfnus | last post by:
Hi, I want to display different forms when the buttons are clicked and all the forms are having different controls on it. So instead of adding new windows forms to the project, i enlarged the...
3
by: Jonas | last post by:
Hi! I have aspx-page where I use multiple panels to make room for more controls than would otherwise fit onto one page. On submit, the controls on all panels, visible or not, should be validated...
1
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
0
by: ohadasor | last post by:
Hello, I'm using .NET Framework 2.0. I'm creating several panels, one above the other, with splitters between them. I'm using Splitter and not SplitContainer, because the latter is such a big...
0
by: aarepasky | last post by:
I am using ASP.NET 2.0 and C#. I am creating a page with multiple panels on it. In the panels are user controls that have the screen layout to input data. I only show one panel at a time by...
1
by: Ben | last post by:
Hi We have a number of Panels on our windows form, we have controls inside and outside of the panels. I am having problems tabbing between controls, it appers to be when the controls are...
3
by: Andrea Gasperi | last post by:
Hi there not sure if this is the right place but i'm proud to use for the first time the "Managed Newsgroups" feature of my brand new MSDN subscription :-) So here is the problem. I've...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.