Solved

How to avoid being child of control?

Posted on 2007-03-30
3
290 Views
Last Modified: 2013-11-07
I have a panel that displays only when a certain button is clicked.  While the panel is hidden, there are a couple of text boxes and labels that display.  The textboxes and labels sit on top of the panel.  Once the panel shows, I call bringtofront().  This hides the textboxes and labels.  It all works fine.

I drop a new textbox onto the form, not the panel.  Then I move it on top of the panel.  It should hide when the panel displays and vice versa.  Just as the above controls do.  The problem is that this new textbox acts like a child of the panel once I move it on top of the panel.  The textbox will now hide when the panel hides, rather than the other way around.  Why does that happen?
0
Comment
Question by:brettr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 18824643
"I drop a new textbox onto the form, not the panel.  Then I move it on top of the panel."

When you move the TextBox over the Panel and let go, it becomes a child of the Panel.  The cursor changes to indicate this.  It places a small box under the arrow to show that the TextBox will be moved into the Panel.

If you want to position the TextBox without changing the container then use the Location() property and type in the x,y values manually.  This will keep the Form as the container.
0
 

Author Comment

by:brettr
ID: 18824734
That would make it difficult at design time.  I need good design time support for arranging controls that display while the panel is hidden.  

I've figured out how to do it.  Move the panel out of the way and arrange all of your controls that aren't children of the panel.  Then move the panel back on top of them.

You suggestion about location can be used at runtime to ensure the panel is always positioned properly.
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 18824741
There's more than one way to skin a cat...   =)
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question