?
Solved

Recommended approach to using container controls

Posted on 2004-10-02
2
Medium Priority
?
207 Views
Last Modified: 2010-04-15
I am not new to .Net in theory but in practice I am fairly new. I am building an application and I am faced with the typical problem of having N different ways of doing it but have not had sufficient experience with the tool to determine which option is the best. What I am after in this case is the accepted / standard / best way of achieving what I want to acheive.

Here is what I want to do.

I have an application that has the following interface

+----------+---------------------------+
|             |                                   |
|             |                                   |
|             |                                   |
|      A     |              B                   |
|             |                                   |
|             |                                   |
+             +---------------------------+
|             |                                   |
|             |             C                    |
+----------+---------------------------+

A = Tree Control
C = Static window that can have other controls placed on it (height of C is fixed but can vary on the width on a resize)
B = Something that can contain another control created at runtime.

The question is about B and C

First B:

I need to be able to dynamically create a control and place it in the area defined by B. The control will need to resize when the window resizes and/or when the slider (between the tree control and B/C) is moved. The main point here is I need some sort of parent entity that handles the resize of the dynamically created control - I don't want to have to handle the resize event in every control I create.

Along the lines of
In The ParentContrl
OnResize
  GetChildObject
  UpdateChildClientArea
  ResizeChild

What would be the best solution here?

Second C:

This will be used to contain 1 or more dynamically created controls like buttons and text boxes. Again I need something to contain these controls.

No need to post source code - unless you really want to - I am looking for the theory rather than the practice.
0
Comment
Question by:Julian Hansen
[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 Comments
 
LVL 1

Accepted Solution

by:
CrazyIvan007 earned 1500 total points
ID: 12207661
Create three Panels,

set A to Docking Left
set B to Docking Fill
set C to Docking Bottom

Then put your Treeview on Panel A

To resize the control in Panel B fetch the Resize Event of Panel B (or if its just a TreeView or ListView it will resize automatic)

You should think about to set Splitter between the Panels. For that create a new Panel Parent_BC where you have to set this Panel at the right Side of Panel A.

Step:

Create Panel A - Docking Left
Create Splitter - Set Docking to Right
Create Panel Parent_BC - Docking Fill
Create Panel C on Parent_BC - Docking Bottom
Create Splitter - Set Docking to Bottom
Create Panel B on Parent BC - Docking Fill

0
 
LVL 58

Author Comment

by:Julian Hansen
ID: 12212365
Thanks CrazyIvan - that got me started nicely.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 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