newbie viariables?

ealand3 used Ask the Experts™
ok this is a serious newbie question but well im new:) Anyways my problem is i open a .mpg from a lstbox using the mediaplayer control but when i try to hide it after playing, the control hides but the video remains visible how can i work around this, if using a second form how would i send the filename string to the 2nd form?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I haven't worked with the media player for mpg files, but maybe it is spawning the Windows media player through Windows?

If not, how are you "hiding" it?  Are you setting the Visible property = false?

>send the filename string to the 2nd form

Several ways.  One is to just make sure the the filename is in a public variable or control, then have the second form simply grab it:  txtOnForm2.Text = Form1.VariableOrControlName

Another way is to add a public property to either form1 or form2, then assign the filename to that property, then have form 2 take it.

on form 2 add

' add this to hold the value passed in
private mstrFilename as string

Public Property Let Form2Filename(strFilename as string)
  mstrFilename = strFilename
end sub

Now, wherever in form 2 you need the filename, just check strFilename.


it uses media player inside the spp not sure if its spawning it but yes i use

vidplayer.visible = false

and the control hides but the last frame of the video that played remains visible i used the public variable to send the strFilename to a second form and when i unload that form the video goes away thank you

Glad you got it working.  Thanks for the A-grade.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial