Hello,
I made a programm of file viewer i want to open txt file
in notepad whenever i double click in the filelistbox 's file extension txt.
Is it Possible
B R
Printable View
Hello,
I made a programm of file viewer i want to open txt file
in notepad whenever i double click in the filelistbox 's file extension txt.
Is it Possible
B R
You can use the ShellExecute API
VB Code:
'put this in a module or decalre it as private instead of public 'declares for shell by association Public 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 Const SW_SHOW As Integer = 5 Public Const SW_NORMAL = 1 'then whereever you want to open the file do this dim ret as integer ret = ShellExecute(0&, "open", File1.Path & "\" & File1.FileName,vbNullString, vbNullString, SW_NORMAL) If ret < 32 Then msgbox "An error occurred" Else msgbox "it worked" End If