PC Review


Reply
Thread Tools Rate Thread

Docking behavior

 
 
Chris Dunaway
Guest
Posts: n/a
 
      11th Aug 2004
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.
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      11th Aug 2004
* 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/>
 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      11th Aug 2004
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.
 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      11th Aug 2004
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.
 
Reply With Quote
 
Jeff Johnson
Guest
Posts: n/a
 
      12th Aug 2004

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:(E-Mail Removed)...

> 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.


 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      12th Aug 2004
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.
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      12th Aug 2004
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



 
Reply With Quote
 
Jeff Johnson [MVP: VB]
Guest
Posts: n/a
 
      12th Aug 2004

"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:4fpzrfhd3dqq.kguj5r2ppt1l$.(E-Mail Removed)...

> > 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Differnet behavior WIA behavior of MS Office SP2 Automata Scanners 0 10th Oct 2006 07:45 AM
differnet behavior WIA behavior of MS Office 2003 SP2 Automata Windows XP General 0 10th Oct 2006 07:44 AM
Changing the docking behavior of toolbar Sinex Microsoft Dot NET Compact Framework 1 10th Mar 2006 01:19 PM
docking menu & docking toolbar Enrique Microsoft VB .NET 4 26th Dec 2005 04:57 AM
docking menu & docking toolbar Enrique Microsoft VB .NET 0 25th Dec 2005 07:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:51 PM.