标题 | 用vbs实现选择颜色 |
内容 | 如果不用组件的话,代码如下: set ie = createobject("internetexplorer.application") ie.navigate "about:blank" do until ie.readystate = 4 : wscript.sleep 25 : loop set doc = ie.document set body = doc.body set win = doc.parentwindow body.innerhtml = "<OBJECT id=dlg CLASSID='clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b'></OBJECT>" body.innertext = doc.getElementById("dlg").choosecolordlg win.clipboarddata.setdata "text", body.innertext ie.quit 如果用组件的话,代码如下: flag = 1+2 initialColor = &hff32ea color = OpenColor(initialColor, flag) MsgBox "Selected color: " & hex(color) function OpenColor(initColor, flags) set comdlg = CreateObject("MSComDlg.CommonDialog") comdlg.Color = initColor comdlg.Flags = flags comdlg.ShowColor OpenColor = comdlg.Color end function |
随便看 |
|
在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。