Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

BindingNavigator Location

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AG - 21 Jul 2006 16:24 GMT
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
Signature


AG
Email: discuss at adhdata dot com

Linda Liu [MSFT] - 24 Jul 2006 03:10 GMT
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.
AG - 25 Jul 2006 21:27 GMT
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?

Signature

AG
Email: discuss at adhdata dot com

> Hi AG,
>
[quoted text clipped - 49 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Linda Liu [MSFT] - 26 Jul 2006 13:12 GMT
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
AG - 26 Jul 2006 14:05 GMT
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.

Signature

AG
Email: discuss at adhdata dot com

> Hi AG,
>
[quoted text clipped - 30 lines]
> Linda Liu
> Microsoft Online Community Support
Linda Liu [MSFT] - 27 Jul 2006 06:21 GMT
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
AG - 29 Jul 2006 02:27 GMT
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.

Signature

AG
Email: discuss at adhdata dot com

> Hi AG,
>
[quoted text clipped - 18 lines]
> Linda Liu
> Microsoft Online Community Support
Linda Liu [MSFT] - 31 Jul 2006 06:19 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.