Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Toolbar button issue

Posted on 2009-05-20
4
184 Views
Last Modified: 2012-05-07
When I add a button to a tool bar I position it where I want it to show but at run time it always positions at the end of the tool bar.  How do I make it stay where I position it.
0
Comment
Question by:Moed
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:oobayly
ID: 24431829
When you say "position", do you mean it's location in pixels from the left, or it's position relative to other toolbar items.
Also, is this the ToolStrip (new with .Net v.2), or the original ToolBar?
Any chance you can post a screenshot comparing design-time to run-time?
0
 
LVL 2

Author Comment

by:Moed
ID: 24431897
This is the tool strip control vs 2008.  When you click the add item button then select button it inserts the button at the last position.  I then drag the button to the position on the toolstrip. When I run the project the button has moved back to the last position.
0
 
LVL 15

Accepted Solution

by:
oobayly earned 250 total points
ID: 24432580
Can't see any reason why that should happen. When you close the project in VS & reopen it, does the button move to the last position like it does at run-time? It sounds like changes to the Designer code aren't being retained. If this is the case, you could try creating a new ToolStrip & adding all the buttons again. Tedious I know, but it's sometimes easier than monkeying around with the Designer generated code.

Could you have any code that manipulates the Toolstrip when the form is constructed or loaded?
0
 
LVL 2

Author Comment

by:Moed
ID: 24433763
Just what I do to overcome the problem.  I've got a feeling you're right about deleting the toolstrip and starting over.  I think I'll skip it for now and just reposition the buttons on the form load.  I thought there might be an easy solution (like index numbers etc..) that I just wasn't seeing.

Thanks for the help.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question