|
-
Feb 12th, 2004, 04:23 PM
#1
Thread Starter
New Member
file list box help
i have a dir list box, a file list box, and a drive list box and i was wondering how i can open any file i click on in the file list box
-
Feb 12th, 2004, 04:41 PM
#2
Frenzied Member
Code:
Private sub command1_click()
shell file1.path & "\" & file1.filename
end sub
Private sub dir1_change()
file1.path = dir1.path
end sub
Private sub drive1_change()
dir1.path = drive1.path
End sub
This will only run executables, I'm sure that there is a way to use the registry to find what application is accosiated to the file, but I cannae do it Scotty
Last edited by Acidic; Feb 12th, 2004 at 04:56 PM.
Have I helped you? Please Rate my posts. 
-
Feb 12th, 2004, 05:04 PM
#3
Something like this?
VB Code:
Option Explicit
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
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
Dim S As String
S = File1.Path
ShellExecute Me.hwnd, "open", S, vbNullString, "C:\", SW_SHOWNORMAL
End Sub
Has someone helped you? Then you can Rate their helpful post. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|