最近在做一个项目,WinForm里面会用到toolStripButton按钮 [新增][存檔][编辑][放弃]之类功能,搭配着dataGridView 但是管理按钮好麻烦尤其按钮比较多的时候,我要去控制例如
toolStripButton1.Enabled = true;
toolStripButton2.Enabled = false;
toolStripButton3.Enabled = true;
toolStripButton4.Enabled = false;有没有比较好的方法或思路可以有效地去控制哪个按钮要true or false?
范例:当dataGridView 有资料时,可以点[编辑],其他关闭,点了[编辑]后[存檔]也能选也能选[放弃]....
各位前辈大哥你们知道我意思吧~一直想不出如何有简洁的方法~
WinFormDataGridView管理
toolStripButton1.Enabled = true;
toolStripButton2.Enabled = false;
toolStripButton3.Enabled = true;
toolStripButton4.Enabled = false;有没有比较好的方法或思路可以有效地去控制哪个按钮要true or false?
范例:当dataGridView 有资料时,可以点[编辑],其他关闭,点了[编辑]后[存檔]也能选也能选[放弃]....
各位前辈大哥你们知道我意思吧~一直想不出如何有简洁的方法~
WinFormDataGridView管理
{
toolStripButton1.Enabled = bBtn1;
toolStripButton2.Enabled = bBtn2;
toolStripButton3.Enabled = bBtn3;
toolStripButton4.Enabled = bBtn4;
}能否简单点?
也许这过程真的省不了了,4楼