Change name of another component when name of component is changed - Grasshopper2024-03-29T13:51:27Zhttps://www.grasshopper3d.com/forum/topics/change-name-of-another-component-when-name-of-component-is?commentId=2985220%3AComment%3A1716970&xg_source=activity&feed=yes&xn_auth=noThe commit and cancel changes…tag:www.grasshopper3d.com,2017-03-21:2985220:Comment:17169702017-03-21T02:45:23.269Z0ddw589ypu3jvhttps://www.grasshopper3d.com/xn/detail/u_0ddw589ypu3jv
<p>The commit and cancel changes tabs are parts of GH_MenuTextBox.</p>
<p>The commit and cancel changes tabs are parts of GH_MenuTextBox.</p> Thanks Panda,
Do you have so…tag:www.grasshopper3d.com,2017-03-20:2985220:Comment:17167522017-03-20T18:05:06.429ZAnton Szilasihttps://www.grasshopper3d.com/profile/AntonSzilasi
<p>Thanks Panda,</p>
<p></p>
<p>Do you have some code that, can use the commit and cancel changes tabs as well? I'm not sure exactly how to access them?</p>
<p></p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769261693?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769261693?profile=original" width="541" class="align-full"/></a></p>
<p>Thanks Panda,</p>
<p></p>
<p>Do you have some code that, can use the commit and cancel changes tabs as well? I'm not sure exactly how to access them?</p>
<p></p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769261693?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769261693?profile=original" width="541" class="align-full"/></a></p> Sorry,it my fault!Just li…tag:www.grasshopper3d.com,2017-03-20:2985220:Comment:17165242017-03-20T13:44:06.853Z0ddw589ypu3jvhttps://www.grasshopper3d.com/xn/detail/u_0ddw589ypu3jv
<p> Sorry,it my fault!Just like this,</p>
<p> <span>if</span> (keyCode == System.Windows.Forms.Keys.Return)<br/> {</p>
<p> this.NickName = sender.Text;</p>
<p> this.linkedCheckList.NickName = sender.Text;<br/> }</p>
<p> Sorry,it my fault!Just like this,</p>
<p> <span>if</span> (keyCode == System.Windows.Forms.Keys.Return)<br/> {</p>
<p> this.NickName = sender.Text;</p>
<p> this.linkedCheckList.NickName = sender.Text;<br/> }</p> Panda,
As always many thanks…tag:www.grasshopper3d.com,2017-03-20:2985220:Comment:17163902017-03-20T13:38:19.930ZAnton Szilasihttps://www.grasshopper3d.com/profile/AntonSzilasi
<p>Panda,</p>
<p></p>
<p>As always many thanks! Unfortunately at the line:</p>
<p></p>
<p>ToolStripTextBox textBox = (ToolStripTextBox)sender;</p>
<p></p>
<p>It is telling me that GH_MenuTextBox cannot be converted to toolStripTextbox, did you build a cast for GH_MenuTextBox? I am going to try doing this</p>
<p>Panda,</p>
<p></p>
<p>As always many thanks! Unfortunately at the line:</p>
<p></p>
<p>ToolStripTextBox textBox = (ToolStripTextBox)sender;</p>
<p></p>
<p>It is telling me that GH_MenuTextBox cannot be converted to toolStripTextbox, did you build a cast for GH_MenuTextBox? I am going to try doing this</p> You can do like this.
publi…tag:www.grasshopper3d.com,2017-03-18:2985220:Comment:17149432017-03-18T00:48:07.105Z0ddw589ypu3jvhttps://www.grasshopper3d.com/xn/detail/u_0ddw589ypu3jv
<p>You can do like this.</p>
<p></p>
<p></p>
<p>public override bool AppendMenuItems(System.Windows.Forms.ToolStripDropDown menu)</p>
<p>{</p>
<p>GH_DocumenObject.<span>Menu_AppendTextItem</span>(menu, this.NickName,<span>new</span> GH_MenuTextBox.<span>KeyDownEventHandler</span>(NameChanged), <span>null</span>, <span>true</span>);</p>
<p>}</p>
<p><span>private</span> <span>void</span> NameChanged(GH_MenuTextBox sender, KeyEventArgs e)<br></br> {<br></br> Keys keyCode = e.KeyCode;…<br></br></p>
<p>You can do like this.</p>
<p></p>
<p></p>
<p>public override bool AppendMenuItems(System.Windows.Forms.ToolStripDropDown menu)</p>
<p>{</p>
<p>GH_DocumenObject.<span>Menu_AppendTextItem</span>(menu, this.NickName,<span>new</span> GH_MenuTextBox.<span>KeyDownEventHandler</span>(NameChanged), <span>null</span>, <span>true</span>);</p>
<p>}</p>
<p><span>private</span> <span>void</span> NameChanged(GH_MenuTextBox sender, KeyEventArgs e)<br/> {<br/> Keys keyCode = e.KeyCode;<br/> <span>if</span> (keyCode == System.Windows.Forms.Keys.Return)<br/> {<br/> ToolStripTextBox textBox = (ToolStripTextBox)sender;</p>
<p> this.NickName = textBox.Text;</p>
<p> this.linkedCheckList.NickName = textBox.Text;<br/> }<br/> <span>else</span> <span>if</span> (keyCode == Keys.Escape || keyCode == Keys.Cancel)<br/> {<br/> }<br/> }</p>