在Strip-Menu中禁用或启用子项

时间:2015-06-02 00:15:08

标签: c# menustrip

请,我想通过代码禁用或启用菜单条的子项。我该怎么办?

看看下面的图片:

enter image description here

1 个答案:

答案 0 :(得分:0)

在代码中,将该菜单条的Enable属性设置为false以禁用,将true设置为启用:

#for each result vector in res_list:
#1) check whether all subsequent elements are different ---> sum(x[-1]==x[-length(x)])==0
#2) and whether we have the same number of elements as in seq1 ---> all.equal(table(x),table(seq1),check.attributes=FALSE)
sum(sapply(res_list,function(x) (sum(x[-1]==x[-length(x)])==0)&all.equal(table(x),table(seq1),check.attributes=FALSE)))
#6085

#the previous number should be the same as the length of res_list
length(res_list)
#6085

#check the number of unique solutions
length(unique(res_list))
#212