﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum / StrataFrame Application Framework / Issues  / Maintenance Form Toolstrip not saving button positions / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Fri, 21 Nov 2008 13:47:56 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>If we don't have the answers, then Google does ;)</description><pubDate>Thu, 22 Jun 2006 12:48:50 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>RE: Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>As usual you guys have the answers.  Thanks again for the sample code.&lt;/P&gt;&lt;P&gt;Jason</description><pubDate>Thu, 22 Jun 2006 12:44:06 GMT</pubDate><dc:creator>Jason Stevenson</dc:creator></item><item><title>RE: Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>What I will do, is look into the possibility of adding properties that will allow you to set the order of the buttons.</description><pubDate>Thu, 22 Jun 2006 09:25:25 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>RE: Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>The "Edit Items..." option does move the buttons around within the collection, but since the order is already serialized within the MaintenanceFormToolstrip's InitializeComponent() method, it cannot add code within the Form's InitializeComponent() method that can change the order.  So, you would need a method like this:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;private&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; ReOrderToolStrip()&lt;BR&gt;&lt;/FONT&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//-- Establish locals&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ToolStripButton&lt;/FONT&gt;&lt;FONT size=2&gt; loNew, loBrowse, loEdit, loDelete, loSave, loUndo;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//-- Save the buttons&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;loNew = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.maintenanceFormToolStrip1.Items[0];&lt;BR&gt;loBrowse = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.maintenanceFormToolStrip1.Items[1];&lt;BR&gt;loEdit = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.maintenanceFormToolStrip1.Items[2];&lt;BR&gt;loDelete = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.maintenanceFormToolStrip1.Items[3];&lt;BR&gt;loSave = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.maintenanceFormToolStrip1.Items[4];&lt;BR&gt;loUndo = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.maintenanceFormToolStrip1.Items[5];&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//-- Clear the buttons&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.maintenanceFormToolStrip1.Items.Clear();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//-- Re-add the buttons in the order you want them&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.maintenanceFormToolStrip1.Items.AddRange(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;ToolStripItem&lt;/FONT&gt;&lt;FONT size=2&gt;[] &lt;BR&gt;{ loSave, loUndo, loNew, loEdit, loDelete, loBrowse });&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;You'll also need to add any ToolStripSeparators you want.&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 22 Jun 2006 09:24:12 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>RE: Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>So should we not use the "Edit Items..." option in the upper right menu of the control?&lt;/P&gt;&lt;P&gt;I was able to override the code manually to put things as they should be, but if I use the designer again it of course blows my changes...&lt;/P&gt;&lt;P&gt;Perhaps I should just use a standard toolstrip, but I sure like what you guys have done for speeding up building such a control set...&lt;/P&gt;&lt;P&gt;Thanks again for your help,&lt;/P&gt;&lt;P&gt;Jason</description><pubDate>Thu, 22 Jun 2006 09:12:49 GMT</pubDate><dc:creator>Jason Stevenson</dc:creator></item><item><title>RE: Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>Hehe, WinForms does take some getting used to, but once you're there, it will take all of your energy to drag yourself away from WinForms and back to WebForms... WinForms is just so much more flexible and friendlier ;)</description><pubDate>Thu, 22 Jun 2006 08:55:52 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>RE: Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>Thank you.  I apologize for my ignorance, as this is my first WinForms application... 10 years of web programming isn't helping here... :)</description><pubDate>Thu, 22 Jun 2006 08:51:15 GMT</pubDate><dc:creator>Jason Stevenson</dc:creator></item><item><title>RE: Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>The problem comes from the MaintenanceFormToolstrip being a control that has it's own InitializeComponent method... when the designer changes the order of the buttons on the toolstrip, it only changes them on the instance of the toolstrip that is in the designer, but it cannot change them when the form runs.  So, you will most likely need to create a method to swap the order of the buttons programmatically when the form instantiates or loads.  Or, you can subclass the MaintenanceFormToolstrip to create your own and put the logic to swap the buttons in there.  Then, your custom toolstrip will have the correct button order, no matter what form you drop it on.</description><pubDate>Wed, 21 Jun 2006 16:44:04 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>Maintenance Form Toolstrip not saving button positions</title><link>http://forum.strataframe.net/Topic1621-10-1.aspx</link><description>Guys,&lt;/P&gt;&lt;P&gt;I am trying to add some additional buttons and move the buttons around on the maintenance form toolstrip control.&lt;/P&gt;&lt;P&gt;It appears to save, but after I run the winforms app they are all put back to default positions.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Jason</description><pubDate>Wed, 21 Jun 2006 15:32:05 GMT</pubDate><dc:creator>Jason Stevenson</dc:creator></item></channel></rss>