請問用vb的日歷控制元件如何制作簡單記事本,就是點擊某一天可以調出記事本寫東西,為什么日歷控制元件加載后第二天日期仍然不變?
uj5u.com熱心網友回復:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
Dim sFilePath As String
With MonthView1
sFilePath = Replace(App.Path & "\" & .Year & "年" & .Month & "月" & .Day & "日.txt", "\\", "\")
Open sFilePath For Output As #1
Close #1
Call ShellExecute(0, "open", "notepad", sFilePath, 0, 1)
End With
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/122869.html
上一篇:怎樣用vb做課程表
