By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,923 Members | 1,950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,923 IT Pros & Developers. It's quick & easy.

Docking behavior

P: n/a
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.
Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
* Chris Dunaway <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> scripsit:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

P: n/a
On 11 Aug 2004 23:09:42 +0200, Herfried K. Wagner [MVP] wrote:
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.
Nov 21 '05 #3

P: n/a
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.
Nov 21 '05 #4

P: n/a

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:1o*****************************@40tude.net...
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.
Nov 21 '05 #5

P: n/a
On Wed, 11 Aug 2004 20:24:19 -0400, Jeff Johnson wrote:

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.
Nov 21 '05 #6

P: n/a
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

Nov 21 '05 #7

P: n/a

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:4f****************************@40tude.net...
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.


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.
Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.