BindingNavigator Location

A

AG

Hi all,

I am just getting into VS 2005 from VS2003 and working through some
exercises from a book.
Drag & Dropped a couple of datasources onto a form and VS added all the
controls including a bindingnavigator and toolstrip.
The bindingnavigator is located above the toolstrip and I would like to have
the toolstrip above the binding navigator.

Neither control is locked, but I can't find any way to move them. Even if I
change the location in the properties, they just go back to the original as
soon as I leave the location row.

Can anyone tell me how to relocate the controls?

TIA
 
L

Linda Liu [MSFT]

Hi AG,

Thank you for posting.

In VS 2005, when you drag&drop a datatable or a field of a datatable from
DataSource panel onto a form, VS will add corresponding controls such as a
DataGridView or TextBoxes and a BindingNavigator on the form. But I don't
see VS add a ToolStrip on the form. Do you mean that VS adds a ToolStrip
besides a BindingNavigator onto the form when you drag&drop datasource onto
the form?

All the controls that are dragged&dropped onto the form are modifiable in
my test. I don't see your problem on my machine.

The version of VS on my machine is Version 8.0.50727.42 (RTM.050727-4200).
The OS on my computer is Windows Server 2003 Enterprise Edition SP1.

Would you tell me the version of VS and OS on your machine? What's the kind
of the form onto which you drag&drop datasource? Is it an inherited form?

I think you may have a try resetting all settings. To do this, go to the
Tools menu, select Import and Export Settings. In the Import and Export
Settings Wizard, select the Reset all settings option, press Next button
and following the directions.

Hope this helps.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

AG

Linda,

Thanks for the reply.

Windows XP Pro Version 2002 SP2
VS 8.0.50727.42 (RTM.050727-4200)

Working in VB.

Reset all settings > restart VS.

Project > Add Windows Form >
Drag & Drop a stored procedure (1 input parameter) data source (option
details) onto the form >
VS add a bindingnavigator, a toolstrip and some textboxes with associated
labels >

The binding navigator is at the top of the form and the toolstrip is below
it.

Dock=Top, Locked=False, for both bindingnavigator and toolstrip.

I would like to have the toolstrip above the binding navigator.

How do I do that?

--

AG
Email: discuss at adhdata dot com
 
L

Linda Liu [MSFT]

Hi AG,

Thanks for your update.

I have performed a test and did see the problem that you decribed. The
BindingNavigator is above the ToolStrip that VS adds to the form.

If I set the BindingNavigator's Dock property to None, the ToolStrip moves
to the top border of the form. Then if I set the BindingNavigator's Dock
property to Top again, the BindingNavigator becomes above the ToolStrip
again.

I think this is because the ToolStrip is added to the form after the
BindingNavigator by VS. Then I have a try exchanging the code of adding the
ToolStrip to the form's Controls collection and that of adding
BindingNavigator in the InitializeComponent method in the form.designer
file.

In my test, the code of adding the ToolStrip to the form is
"this.Controls.Add(this.fillToolStrip);"
and that of adding the BindingNavigator is
"this.Controls.Add(this.getCityBindingNavigator);"

What I do is just exchanges the places of two statements. It works. Switch
to the form's designer, the ToolStrip becomes above the BindingNavigator
now.

Hope it helps.
If you have anything unclear, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support
 
A

AG

Thanks Linda,

That does work. The only question is - will VS at some point change it back?
There is the warning at the top of the method ...
'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.
 
L

Linda Liu [MSFT]

Hi AG,

Thanks for your response.

No, VS won't change the code in the InitializeComponent method back unless
you delete the ToolStrip and BindingNavigator on the form and then put them
back to the form again.

It is recommended not to modify the code in the InitializeComponent method
using the code editor. Instead, VS IDE will generate the code
automatically. It is because if there're errors after you modify the code
in the method using the code editor, VS could not open the form in the form
designer at next time.

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support
 
A

AG

Thanks Linda,

I am in the process of reading a new book and just found the 'correct' way
to change the order via VS.
View > Other Windows > Document Window. One can easily change the order of
any control.
 
L

Linda Liu [MSFT]

Hi AG,

Yes, you have found a more formal way to change the orders of the controls
that are added onto the form. I think it will benefit all readers in the
newsgroup.

If you have any other questions in the future, please don't hesitate to
contact us.

Have a nice day!

Sincerely,
Linda Liu
Microsoft Online Community Support
 

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