我要双击文件列表File,用打开记事本打开文件的

小雨家庭教育 | 学以知道 , 教以成德!         

问题描述

我要双击文件列表File,用打开记事本打开文件的希望能解答下
精选答案
最佳答案

如果一定要用记事本,可以这样用Private Sub File1_DBClick()Shell "notepad.exe " & Replace(File1.Path & "\" & File1.FileName,"\\","\"), vbNormalFocusEnd Sub对任意文件的打开,可以用下面的方法: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 LongPrivate Sub File1_DBClick()ShellExecute Me.hWnd, "open",Replace(File1.Path & "\" & File1.FileName,"\\","\"), "", "", 0 End If

更多推荐
(c)2008-2025 广知网 All Rights Reserved 鄂ICP备2023002720号-19