HTA: カレンダーコントロール
HTA から Microsoft Office の ActiveX コントロールを呼び出す例。(要Office環境/Office 2010を除く)
・calendar.hta
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | <html><!-- '***************************************************************************** '* '* NAME : Simple Calendar '* '* DESCRIPTION : Displays the selected date. '* '* VERSION HISTORY: '* 1.0 2012-04-22 Initial release by mogproject '* '***************************************************************************** --><head> <meta http-equiv= "Content-Type" content= "text/html; charset=Shift_JIS" > <title> </title> <script language= "VBScript" ><!-- '************ Initialize window size ************ resize_window 300, 300 '***************************************************************************** '* Sub resize_window() '* '* Purpose: Resize a window to the specified width and height, '* and then set its position to center. '* Input : width - Sets the width of the window, in pixels (Integer) '* height - Sets the height of the window, in pixels (Integer) '* Output : None '***************************************************************************** Sub resize_window(width, height) If width > screen.width Then width = screen.width If height > screen.height Then height = screen.height window.resizeTo width, height window.moveTo (screen.width - width) / 2, (screen.height - height) / 2 End Sub --></script> <HTA:APPLICATION ID = "hta" APPLICATIONNAME= "Simple Calendar" VERSION = "1.0" ICON = "" BORDER = "normal" BORDERSTYLE = "normal" CAPTION = "yes" INNERBORDER = "yes" MAXIMIZEBUTTON = "yes" MINIMIZEBUTTON = "yes" SHOWINTASKBAR = "yes" SINGLEINSTANCE = "yes" SYSMENU = "yes" WINDOWSTATE = "normal" SCROLL = "no" SCROLLFLAT = "yes" SELECTION = "no" CONTEXTMENU = "yes" NAVIGABLE = "no" /> <script language= "VBScript" ><!-- '***************************************************************************** '* Sub Window_OnLoad() '* '* Purpose: Initialization tasks. '* Input : None '* Output : None '***************************************************************************** Sub Window_OnLoad() document.title = hta.applicationName & " v" & hta.version Calendar_AfterUpdate End Sub '***************************************************************************** '* Sub Calendar_AfterUpdate() '* '* Purpose: Update date string. '* Input : None '* Output : None '***************************************************************************** Sub Calendar_AfterUpdate() divDate.innerHtml = Calendar.Value End Sub --></script> <style type= "text/css" ><!-- body { font-family : Verdana, Arial, Helvetica, Sans-serif; font-size : 14px; font-weight : normal; background-color: #ccffcc; color : #000000; margin : 0px 0px 0px 0px; } table { border-collapse: collapse; border-spacing : 0px; border-width : 0px; border-style : solid; } --></style> </head> <body> <table width= "100%" > <tr> <td> <object id= "Calendar" classid= "clsid:8e27c92b-1264-101c-8a2f-040224009c02" width= "100%" height= "200px" ></object> </td> </tr> <tr height= "40px" > <td align= "center" ><div id= "divDate" /></td> </tr> </table> </body> </html> |
0 件のコメント:
コメントを投稿