Please MS Fix this

L

Lloyd Sheen

I am running into a common problem (at least for me). I just want a simple
win app with a panel at the top, a splitter in the middle and another panel
at the bottom. No amount of coaxing will allow this to happen in the
designer. No amount of send to back / front or any other command that is
obvious will allow this.

This is supposed to be a RAD designer. What I wanted to do should take no
more than 30 seconds but now has taken much too long a time.

Please help.

Lloyd Sheen
 
R

Ron Allen

Lloyd,
I just did this to test and it worked just fine with the designer. I
created a new form and added a panel to it with dock = top. I then dragged
a splitter to the form and set dock = top and put a panel below this with
dock = fill. With just this you may need to set the color of the splitter
so that it is easily visiible or make it taller. I used ControlDark. If
you don't do this the splitter will be the same color as the panel
background and the only clue that you are over it is the cursor changing
shape.

Ron Allen
 
T

Terry

That's very odd. I've never had a problem doing this in the designer.

This is what I do:

1. Add the first panel to the form - set it's dock property to "Top"
2. Add the splitter to the form - set it's dock property to "Top"
3. Add the second panel to the form - set it's dock property to "Fill"

Done! Works perfectly for me. What version of VS.NET are you using?
 
N

Nick Moore

Terry said:
That's very odd. I've never had a problem doing this in the designer.

This is what I do:

1. Add the first panel to the form - set it's dock property to "Top"
2. Add the splitter to the form - set it's dock property to "Top"
3. Add the second panel to the form - set it's dock property to "Fill"

Done! Works perfectly for me. What version of VS.NET are you using?

I'm having a similar problem. I want three panels on a form. The
first one docked left with a vertical splitter to its right, this
works fine. I then want the remaining part of the form split into two
with a panel at the top, a panel at the bottom and a horizontal
splitter between them. The problem comes when I try to add the second
panel and dock it to the top, the second panel gets docked right
across the top, overlaying the panel docked to the left instead of
positioning itself at the top and to the right of my left-docked
panel! What am I doing wrong??

Nick Moore
 
R

Ron Rohrssen

Just for kicks I thought I'd give this a try.

Both of these worked perfectly. I'm sort of disappointed that they did.

I have seen the problems that you have described here. I don't know why the
designer seems to get "stuck" sometimes. (VS.NET 2003 Professional fully
patched as of 1/22/2004)

When I've had this problem in the past, I have found it necessary to hand
tweak the code that adds controls to the form controls list.
So, the code should have been like this:
this.Controls.Add(this.panel3); //dock left
this.Controls.Add(this.splitter2); //dock left
this.Controls.Add(this.panel2); //dock top
this.Controls.Add(this.splitter1); //dock top
this.Controls.Add(this.panel1); //dock top

But, I have occassionally seen the designer get stuck where the panels are
added out of order. Or the splitter is added after a panel, etc.

I think if you look at the order of the controls added to the form you might
be able to correct the problem.

Ron
 
A

Andrew S \(Infragistics\)

The position of docked controls is based on zorder. Try playing around with
BringToFront and SendToBack off the context menu of the controls.
 
A

Andrew Bingham

Yep I had the same problem and the order in which you add controls IS
important.

Changing the Z-Order does not always seem to work.

When it doesn't I undock the controls and then redock them in the order I
want. Sometimes when doing this I have to delete a splitter because it
simply won't re-dock where I want it to, bu thti sis no great hardship
PROVIDING I add it back in the right order.

cheers

Andrew
--
****************************************************************************
andrewbingham.com

tel 01223 514674 (Cambridge)
mobile 07970 161057
fax 07970 601283
email (e-mail address removed)

DISCLAIMER, PLEASE NOTE:
This communication is for the attention of the named recipient only
The content should not be passed on to any other person.
It is sent in good faith, in confidence, and without legal responsibility.

VIRUS CHECK
Emails and attachments are virus checked using Norton® AntiVirus®
2002 which is regularly updated. However it remains the recipients
responsibility to check emails and attachments sent, or forwarded,
from andrewbingham.com for viruses and macro viruses
****************************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top