Solved

Toolbar button issue

Posted on 2009-05-20
4
181 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now