943,777 Members | Top Members by Rank

Ad:
Jan 31st, 2008
0

How to load a filename on a LISTBOX

Expand Post »
any pls help mo on How to load a filename on a LISTBOX.
also pls teach me that when i click on the filename loaded on the listbox
it will run,

i only need to load the names of my movieclips which is all (.avi)
then when click will play on a media player

pls help.... search and tried lot of ideas
none work
Similar Threads
Reputation Points: 10
Solved Threads: 2
Junior Poster
hawisme000 is offline Offline
102 posts
since Jul 2007
Feb 1st, 2008
0

Re: How to load a filename on a LISTBOX

well if you want to add the filenames on a listbox, you will have to make use of "FileSystemObject" you can define it as
dim Fsys(or any other name of the variable) as filesystemobject
once yopu have defined it, you can reference its features by
Fsys.
try it it has worked for me. And if you want I can send you the program I made to do the same thing. As far as playing a file in media player is concerned, you will have to give reference to media player in the program and place a media player control, which will be used to play the file.

Rajesh Khanna
Reputation Points: 10
Solved Threads: 1
Light Poster
rajeshkhanna_in is offline Offline
39 posts
since Jan 2008
Feb 1st, 2008
1

Re: How to load a filename on a LISTBOX

Click to Expand / Collapse  Quote originally posted by hawisme000 ...
any pls help mo on How to load a filename on a LISTBOX.
also pls teach me that when i click on the filename loaded on the listbox
it will run,

i only need to load the names of my movieclips which is all (.avi)
then when click will play on a media player

pls help.... search and tried lot of ideas
none work
Hi,

Rather than use a listbox, I would say use a FileListBox (shown in the toolbox as a piece of paper with lines across).
After you have added that in, go to the FileListBox's properties and you'll need to change Pattern to *.avi (it is currently *.* to show all files).

On form load you'd need to set it to look at a particular directory for example:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Form_Load()
  2. File1.Path = "c:\movies"
  3. End Sub

Then you'd need to make an onClick method for the FileListBox to load the file up when a file is clicked. You could make it on double click to make it harder to accidentally run one of the movies.

You could call the media player's executable file and pass the filename (including path) as an additional command (this is the way I'd do it personally).
Alternatively, there may be a way of just running the file and it loads the default application - unfortunately I don't how how this would be done though.

Hope that helps.
Reputation Points: 13
Solved Threads: 17
Junior Poster
jonifen is offline Offline
152 posts
since Nov 2007
Feb 1st, 2008
1

Re: How to load a filename on a LISTBOX

Click to Expand / Collapse  Quote originally posted by hawisme000 ...
any pls help mo on How to load a filename on a LISTBOX.
also pls teach me that when i click on the filename loaded on the listbox
it will run,

i only need to load the names of my movieclips which is all (.avi)
then when click will play on a media player

pls help.... search and tried lot of ideas
none work
though you can easily solve this prob using the standard file listbox intrinsic control , i'm attaching a sample code here that is capable in doing exactly what u want. it uses an ordinary listbox to collect the filenames and display them. also you can click an item into the listbox to play it in the media player.
in this sample i've used windows media player control (9 series) which in default not installed in every machine. the default one is windows media player 6.4 . so if u got any trouble on that plz forward ur problems. i'll solve them out.

see the screenshot also...

ok......

regards
Shouvik
Attached Thumbnails
Click image for larger version

Name:	Snapshot.JPG
Views:	41
Size:	35.4 KB
ID:	4967  
Attached Files
File Type: zip Media Player.zip (28.4 KB, 120 views)
Last edited by choudhuryshouvi; Feb 1st, 2008 at 5:27 am.
Reputation Points: 30
Solved Threads: 49
Posting Pro
choudhuryshouvi is offline Offline
553 posts
since May 2007
Feb 2nd, 2008
0

Re: How to load a filename on a LISTBOX

Thx alot to all of u, before i read this post i was able to make a program that save's and load a video, but somehow i can only save the name into a URL format on a database, have no idea about that fileLIstBox. and sir choudhuryshouvi thx a lot on your sample file it really really help me and my group. one's i finished my prob(thats related to this) maybe ill start a new thread about that FileListBOx, Really thx !
Reputation Points: 10
Solved Threads: 2
Junior Poster
hawisme000 is offline Offline
102 posts
since Jul 2007
Feb 4th, 2008
0

Re: How to load a filename on a LISTBOX

u r welcome
if there is any more problem tell me

ok......

regards
Shouvik
Reputation Points: 30
Solved Threads: 49
Posting Pro
choudhuryshouvi is offline Offline
553 posts
since May 2007
Feb 5th, 2008
0

Re: How to load a filename on a LISTBOX

That is a simple but excellent piece of code for beginners.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Feb 5th, 2008
0

Re: How to load a filename on a LISTBOX

thanks for such an honorable comment.
thanks once again debasisdas

regards
shouvik
Reputation Points: 30
Solved Threads: 49
Posting Pro
choudhuryshouvi is offline Offline
553 posts
since May 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB Select Statement Query
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: line1.bordercolor ??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC