台历怎么编啊,用什么命令啊
学校让做一个时钟与台历的实验,这个台里怎么搞啊...指导一下...
*----------------------- * 主程序 *----------------------- Form1 = CREATEOBJECT("_Calendar") && 建立表單實例,從以下_Calender類定義中來 Form1.Show && 顯示表單 READ EVENTS && 啓動消息事務處理機能 RELEASE Form1 && 釋放表單所佔用的內存(連同外掛的ole控件) RETURN && 交回VFP界面 *----------------------- * 表單類定義 *----------------------- DEFINE CLASS _Calendar AS Form Caption = "臺曆程序樣板" && 窗體標題 Width = 600 && 窗體默認寬度(像素) Height = 400 && 窗體默認高度(像素) BorderStyle = 1 && 單線窗體邊框(不允許手動改變窗體大小) MinButton = .F. && 不提供最小化按鈕 MaxButton = .F. && 不提供最大化或恢復按鈕 AutoCenter = .T. && 窗體啓動時自動在_SCREEN窗體居中 ADD OBJECT ole_Calendar AS OleControl WITH OleClass = "MSCAL.Calendar.7" && 添加ole日曆控件(或與版本有關,應查核,此爲2.0版日曆控件) ADD OBJECT Edit1 AS EditBox WITH Value = "" && 添加記事本控件 ADD OBJECT cmd_Note AS CommandButton WITH Caption = "記事" ADD OBJECT cmd_Clear AS CommandButton WITH Caption = "清除" *--------------------- * 窗體初始化代碼 *--------------------- PROCEDURE Init WITH ThisForm *-------------------- * 批量設置CommandButton類按鈕的屬性,當控件數量較多時可節省代碼,有利於維護 *-------------------- .SetAll("Height", 40, "CommandButton") .SetAll("Width", 60, "CommandButton") .SetAll("FontName", "微软雅黑", "CommandButton") .SetAll("FontSize", FONTMETRIC(1), "CommandButton") ENDWITH ENDPROC *--------------------- * 窗體激活時執行的代碼 *--------------------- PROCEDURE Activate WITH ThisForm.cmd_Note .Top = ThisForm.Height - .Height - 5 .Left = 20 ENDWITH WITH ThisForm.cmd_Clear .Top = ThisForm.cmd_Note.Top .Left = ThisForm.cmd_Note.Left + ThisForm.cmd_Note.Width ENDWITH WITH ThisForm.ole_Calendar .Top = 5 .Left = 5 .Height = ThisForm.cmd_Note.Top - .Top - 5 .Width = 300 ENDWITH WITH ThisForm.Edit1 .Top = 5 .Left = ThisForm.ole_Calendar.Left + ThisForm.ole_Calendar.Width + 5 .Height = ThisForm.Height - .Top - 5 .Width = ThisForm.Width - .Left - 5 ENDWITH ENDPROC *--------------------- * 釋放窗體時執行的代碼(點擊關閉窗體按鈕時自動觸發,通過任何手段釋放窗體時都會動作) *--------------------- PROCEDURE Destroy CLEAR EVENTS ENDPROC *--------------------- * 點擊日曆控件時執行的代碼(具體有些什麽屬性、事件、方法,應查控件的資料) *--------------------- PROCEDURE ole_Calendar.Click ThisForm.Edit1.Value = STR(This.Year,4) + "/" + PADL(This.Month, 2, '0') + "/" + PADL(This.Day, 2, '0') ENDPROC ENDDEFINE