hey all..
how can i capture the format (example: .exe, .txt) of a file being displayed in a file list box??
Printable View
hey all..
how can i capture the format (example: .exe, .txt) of a file being displayed in a file list box??
Use the properties - File1.Path and/or File1.FileName
Are you sure you're in the right place, sevenhalo? This is VB6 forum... ;)
So how will it go??
For example:
If file1.filename = *.wav then
mmcontrol1.devicetype = "Wave Audio"
end if
like that??
This will tell you what is selected.
VB Code:
Private Sub File1_Click() MsgBox File1.List(File1.ListIndex) End Sub
This will parse the file extension and add an asterisk in front of it.
VB Code:
Option Explicit Private Sub File1_Click() MsgBox "*" & Mid$(File1.List(File1.ListIndex), InStrRev(File1.List(File1.ListIndex), ".")) End Sub
thanx for the effort...but let me clarify :)...
Im designing a media player...something that plays music (for now)...and im using a multi media control...so i need to specify a "device type" based on the file extension for the file im trying to play...
and since i dont know whats the file extension...i have to capture it from the file list box...
thus: for example:
if (statement to capture the extension) = .wav then
mmcontrol1.devicetype = "Wave Audio"
end if
sorry didnt see ur last post...i think that will work...thanxx;)