For
i
=
1
To
10
ActiveSheet.Buttons.Add(54,
i
*
27,
108,
30).Select
Selection.OnAction
=
"buttonattribute_"
&
i
Next
i
Sub
buttonattribute_1()
MsgBox
1
End
Sub
Sub
buttonattribute_2()
MsgBox
2
End
Sub
Sub
buttonattribute_3()
MsgBox
3
End
Sub
...
Sub
buttonattribute_10()
MsgBox
10
End
Sub
buttons:{"关闭": function(){
},
"你想加的button": function(){
//不需要加id
}
}
//获取
var buttons = $('.selector').dialog('option', 'buttons')
//设置
$('.selector').dialog('option', 'buttons', { "Ok": function() { $(this).dialog("close") } })
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)