| | |
Open any file and List.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
1
Please, how can i make Visual Basic 6 open a HTML file (with Iexplore, let's say), or one MP3 (with Media Player instead of Winamp, let's say), when i click a button? It is possible?
I mean, for the HTML, i need the default program to open the file, but for mp3, i really want media player.
2
I have a list with 20 songs. When i click one of them (let's say song mumber 4), the buttons PLAY anf LYRICS appear. I don't know how to make only mp3 number 4 to play when i click item number 4 in the list. Big problem for me... The html lyrics are very easy to run, i use labels, it's exactly like the mp3.
Please, please, plese help.
Please, how can i make Visual Basic 6 open a HTML file (with Iexplore, let's say), or one MP3 (with Media Player instead of Winamp, let's say), when i click a button? It is possible?I mean, for the HTML, i need the default program to open the file, but for mp3, i really want media player.
2
I have a list with 20 songs. When i click one of them (let's say song mumber 4), the buttons PLAY anf LYRICS appear. I don't know how to make only mp3 number 4 to play when i click item number 4 in the list. Big problem for me... The html lyrics are very easy to run, i use labels, it's exactly like the mp3.Please, please, plese help.
Maybe 2: is not easy to understand.
I have a form and a ListBox on it. In this listbox, i have 20 items in a list (i pasted the names if each track). Each item from the List corespounds with a ItemData, 1 is for track number 1, 2 is for track number 2 and so on. 20 is for track number 20.
Now, when i execute the program, i see the form and the listbox. When i click, let's say track number 4, 2 new buttons appear: PLAY and LYRICS. Play will play the mp3 and lyrics will open the html file with the lyrics. Simple as that.
I dont know how to open one CERTAIN MP3 from the list, with Winamp, from the click of one button. This is all i want to do.
Thank you in advance.
I have a form and a ListBox on it. In this listbox, i have 20 items in a list (i pasted the names if each track). Each item from the List corespounds with a ItemData, 1 is for track number 1, 2 is for track number 2 and so on. 20 is for track number 20.
Now, when i execute the program, i see the form and the listbox. When i click, let's say track number 4, 2 new buttons appear: PLAY and LYRICS. Play will play the mp3 and lyrics will open the html file with the lyrics. Simple as that.
I dont know how to open one CERTAIN MP3 from the list, with Winamp, from the click of one button. This is all i want to do.
Thank you in advance.
Errr...
One more problem: what lybrary do i have to add for this ShellExecute function to work? Or, what should i define? I don't know how API works...
Let's suppose i want "track1.mp3" to be launched when i press button1.
doesn't work (function not defined), considering that the "track1.mp3" is in the same directory as the executable.
I'm sorry... my visual basic skills are very low.
:-|
One more problem: what lybrary do i have to add for this ShellExecute function to work? Or, what should i define? I don't know how API works...
Let's suppose i want "track1.mp3" to be launched when i press button1.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub button1_Click() ShellExecute "track1.mp3" End Sub
I'm sorry... my visual basic skills are very low.
:-| Depends on if you want to launch the MP3 with the default application or not...... here is an example project that you can use that allows you to select if you want to use the default application, or if you want to specify an application to use when launching the file. It's fully commented, so let me know how it turns out for you.
Ok. Opening files works LIKE A MIRACLE! That part of the question is 100% solved.
Now, the select file from a listbox part. When i created the "ListBox" i went to ItemData and completed the field with the list of 4 files, and then i completed the "List" with 0, 1, 2, and 3.
Here is the attached project.
I still don't know how to execute only the SELECTED file from one long list of files in listbox. In this example, i used 4 files, but what if i have 100 files? And what if they are not called that simple, "track(x).mp3"?... big problem for me... :rolleyes:
Now, the select file from a listbox part. When i created the "ListBox" i went to ItemData and completed the field with the list of 4 files, and then i completed the "List" with 0, 1, 2, and 3.
Here is the attached project.
I still don't know how to execute only the SELECTED file from one long list of files in listbox. In this example, i used 4 files, but what if i have 100 files? And what if they are not called that simple, "track(x).mp3"?... big problem for me... :rolleyes:
I don't understand completely what you are trying to do.... but I can tell you that in order to get the selected item in the listbox, you can say:
and that will return the value (in a single-select only listbox) selected in the listbox....
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
selitem = list1.list(list1.listindex)
Perfect. The code you gave me worked almost as i wanted. :mrgreen:
So everything would be solved in here.
Now, i have another question, but i think i should do another thread, cose it it has nothing to do with this one...
Better not make a new thread:
I have a very very very long text (*.TXT) file. The lines are small, but many. Now i want to make this a HTML file. The <html><body> tags are easy to do, the HUGE problem is adding a <br> at the end of each line. Now, i know it is very simple to detect the end of each line in Visual Basic and add a "<br>" string at the end, WITHOUT altering the text written in there...
Please? I know i have to open the txt file for reading and writing... but i am stuck after this point.
So everything would be solved in here.
Now, i have another question, but i think i should do another thread, cose it it has nothing to do with this one...
Better not make a new thread:
I have a very very very long text (*.TXT) file. The lines are small, but many. Now i want to make this a HTML file. The <html><body> tags are easy to do, the HUGE problem is adding a <br> at the end of each line. Now, i know it is very simple to detect the end of each line in Visual Basic and add a "<br>" string at the end, WITHOUT altering the text written in there...
Please? I know i have to open the txt file for reading and writing... but i am stuck after this point.
You should have started a new thread.
or
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
open textfile for input as #1 open htmlfile for output as #2 do until eof(1) line input #1, chk print #2, chk & "<BR>" loop close #1 close #2
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
open textfile for input as #1 open htmlfile for output as #2 do until eof(1) line input #1, chk chk = Replace(chk, vbNewLine, "<BR>") loop close #1 close #2
![]() |
Similar Threads
- Open Excel file from Visual Basic (Visual Basic 4 / 5 / 6)
- Open Excel File (VB.NET)
- How to open txt file (Visual Basic 4 / 5 / 6)
- how to open a pdf file using form in access and creation of browser button (Visual Basic 4 / 5 / 6)
- open a PDF file in visual basic (Visual Basic 4 / 5 / 6)
- "Cannot Open Include File" MS Visual C++ error (C++)
- open an https file (Python)
- how to open vaw file (Java)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: if then else, case
- Next Thread: Scrollbar in Form (VB6.0)
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
6 429 2007 access activex add age append application basic beginner birth c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






