我使用下面的代碼來啓用/禁用我的usercontol中的按鈕控件,該工具完美工作。如何在UserControl的工具欄中查找toolstripButton
var btnAdd = this.userControlCommonTask1.Controls.Find("btnAdd", true);
btnAdd[0].Enabled = true;
但是,當我用按鈕(btnAdd,btnEdit,btndelete蝕刻..)toostrip(toolstrip1),並使用上述
我的代碼有:
Index was outside the bounds of the array.
我試過這個,但它只適用於工具條。
var btnAdd = this.userControlCommonTask1.Controls.Find("toolstrip1", true);
btnAdd[0].Enabled = true;
感謝問候
雖然我的評論有點偏離軌道,但我想知道,假設您在用戶控件中使用工具條,將條目添加到工具條之後,如果複製整個usercontrol並將其粘貼到其他位置,則是它保存工具條的項目?如果是,那麼你如何實現它?問候! – priyamtheone 2013-02-18 18:17:12