本帖最后由 pcl_test 于 2017-4-13 12:15 编辑
- Set ws = CreateObject("WScript.Shell")
-
- list=split("项目一|项目二|项目三|项目四|项目五","|")
- For i=0 To UBound(list)
- info=info&"<input type='checkbox' name='check' value='"& i+1 &"'> "& list(i) &"<br>"
- Next
-
- msgbox CheckBox(info)
-
- Function CheckBox(info)
- CheckBox = ws.Exec("mshta.exe ""about:<HTA:APPLICATION ShowInTaskbar='no' Scroll='no' MaximizeButton='no' MinimizeButton='no' />" &_
- "<title>请选择</title><script>window.resizeTo(180, 220);" & _
- "function choise(){var result='', list=document.getElementsByName('check');" & _
- "for(var i=0;i<list.length;i++){if(list[i].checked==true)result+=list[i].value+'|';}" & _
- "(new ActiveXObject('Scripting.FileSystemObject')).GetStandardStream(1).write(result.replace(/\|$/, ''));close();}</script>" & _
- "<body style='text-align:center'><div><font style='color:#008200;'>"& info &"</font></div><br>" & _
- "<input type='button' value='确定' onclick='choise()'></body>""").StdOut.ReadAll
- End Function
复制代码
|