c# - Toolstrip.Items.AddRange(ToolStripCollection) has odd behavior -


part of application i'm working on involves dynamic toolstrip items added , removed depending on application's state. i'm storing items in various independent toolstrips , adding , removing them when necessary. problem i'm having this:

-if new toolstip has 1 item , use method addrange, it's removed new toolstrip, giving item count of 0.

-if new toolstrip has multiple items , use addrange, argumentoutofrange error thrown.

is there toolstripitemcollections i'm unaware of that's causing this, or there better way go programming this?

edit: quick example code

toolstrip oldtoolstrip = new toolstrip(); toolstrip newtoolstrip = new toolstrip();  newtoolstrip.items.add(new toolstriptextbox()); newtoolstrip.items.add(new toolstripbutton());  oldtoolstrip.items.addrange(newtoolstrip.items);             

there bug control: http://www.pcreview.co.uk/forums/possible-bug-toolstrip-items-addrange-t2900540.html


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -