﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » How to update a ToolStrip after programmatically adding a ToolStripButton</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 12 Jun 2026 07:38:19 GMT</lastBuildDate><ttl>20</ttl><item><title>How to update a ToolStrip after programmatically adding a ToolStripButton</title><link>http://forum.strataframe.net/FindPost4816.aspx</link><description>In the constructor of a form, after the InitializeComponent, I add a ToolStripButton to a ToolStrip. When the form opens the new buttons isn't shown, until I manually move it.  I've tried .Update, .Refresh, .Invalidate + .Refresh. I've tried these in the constructor, in form load, in form activate. Nada.  How do you get a ToolStrip to repaint after changing the Items collection?</description><pubDate>Tue, 28 Nov 2006 22:29:40 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to update a ToolStrip after programmatically adding a ToolStripButton</title><link>http://forum.strataframe.net/FindPost4844.aspx</link><description>Good to hear :)</description><pubDate>Tue, 28 Nov 2006 22:29:40 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to update a ToolStrip after programmatically adding a ToolStripButton</title><link>http://forum.strataframe.net/FindPost4843.aspx</link><description>huh.  Well, what I finally got to work was to move it slightly, the call refresh...&lt;br&gt;
&lt;br&gt;
' Move it bit to left, then back to original place, then it redraws&lt;br&gt;
me.myToolStrip.Location = New System.Drawing.Point(me.myToolStrip.Location.X +1,me.myToolStrip.Location.Y)&lt;br&gt;
me.myToolStrip.Location = New System.Drawing.Point(me.myToolStrip.Location.X -1,me.myToolStrip.Location.Y)&lt;br&gt;
me.myToolStrip.Refresh()&lt;br&gt;</description><pubDate>Tue, 28 Nov 2006 22:28:09 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to update a ToolStrip after programmatically adding a ToolStripButton</title><link>http://forum.strataframe.net/FindPost4825.aspx</link><description>You know... I'm not sure.&amp;nbsp; Calling Invalidate() will always cause the control to redraw itself.&amp;nbsp; However, in my test, it worked fine... the button was visible as soon as the form displayed.&lt;/P&gt;&lt;FONT color=#0000ff size=1&gt;&lt;P&gt;Public&lt;/FONT&gt;&lt;FONT color=#000000 size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Sub&lt;/FONT&gt;&lt;FONT color=#000000 size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;New&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#000000&gt;()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=1&gt;' This call is required by the Windows Form Designer.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;P&gt;InitializeComponent()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=1&gt;' Add any initialization after the InitializeComponent() call.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Me&lt;/FONT&gt;&lt;FONT size=1&gt;.ThemedToolStrip1.Items.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;New&lt;/FONT&gt;&lt;FONT size=1&gt; ToolStripMenuItem(&lt;/FONT&gt;&lt;FONT color=#e10000 size=1&gt;"Howdy"&lt;/FONT&gt;&lt;FONT size=1&gt;))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;End&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;Sub&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 28 Nov 2006 13:57:30 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>