Docking behavior

C

Chris Dunaway

Where/How does VS determing docking order?

I created a form with a panel docked to the top and a tab control with fill
docking.

I had added some tabs and place some controls, etc., and decided to add a
status bar to the main form. I add the status bar and docked it to the
bottom, but the tabControl when docked as filled, fills *behind* the status
bar.

If I create a new form and put the status bar first, docked to the bottom
and then the panel docked to the top, then the tab control fills correctly
and doesn't go behind the StatusBar. What gives?

I don't want to have to rebuild the form because it will be tedious to do
so, but I cannot find a way to get the docking behavior correct.


--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
H

Herfried K. Wagner [MVP]

* Chris Dunaway said:
Where/How does VS determing docking order?

Play around with the controls' "Bring to front" and "Send to back" context menu
entries to change the order.
 
C

Chris Dunaway

Play around with the controls' "Bring to front" and "Send to back" context menu

Thanks. Bring to Front did the trick.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
C

Chris Dunaway

On 11 Aug 2004 23:09:42 +0200, Herfried K. Wagner [MVP] wrote:

Where is the order of the controls stored? It does not seem to be in the
..vb file for the form, yet the IDE remembers the settings each time I start
it. I thought it might be related to the order in the source in which the
controls are instanciated, but that seemed to make no sense.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
J

Jeff Johnson

Where is the order of the controls stored? It does not seem to be in the
.vb file for the form, yet the IDE remembers the settings each time I start
it. I thought it might be related to the order in the source in which the
controls are instanciated, but that seemed to make no sense.

It's dependent on the order that the controls are added to the form. If you
expand the "forbidden" Windows Forms Designer generated code region and look
near the end you'll see the controls get added.
 
C

Chris Dunaway

It's dependent on the order that the controls are added to the form. If you

I tried changing the order in which the controls are added by adjusting
that code and it made no difference, whatsoever to the docking behavior.
That was the first thing I tried.

I speculate that the settings are stored in the hidden .suo file in the
project directory.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
C

Cor Ligthert

Chris,

Are you sure of that,

You can try this, create a project with 3 draged 3 textboxes on it, 1, 2, 3,
in this sequence and give them all the property dock = bottom.

Than this you will see them change.

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Me.Controls.Remove(Me.TextBox3)
Me.Controls.Remove(Me.TextBox2)
Me.Controls.Remove(Me.TextBox1)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox3)
End Sub

In other words "the last has the highest order"

I hope this helps?

Cor
 
J

Jeff Johnson [MVP: VB]

you

I tried changing the order in which the controls are added by adjusting
that code and it made no difference, whatsoever to the docking behavior.
That was the first thing I tried.

I speculate that the settings are stored in the hidden .suo file in the
project directory.

Nope. If you play around with Bring to Front and Send to Back and examine
the generated code immediately after each "move," you'll see how the
designer swaps things around.

Remember that Visual Studio is totally unnecessary for the creation of .NET
programs; you could write them in Notepad. Everything about how a .NET
program works is dependent on source files, so that's where everything is
stored. The .suo file is for Visual-Studio-specific options.
 

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