movies to buttons, need help
movies to buttons, need help
movies to buttons, need help
movies to buttons, need help
movies to buttons, need help
movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help
movies to buttons, need help movies to buttons, need help
movies to buttons, need help
Go Back  Xtreme Visual Basic Talk > > > movies to buttons, need help


Reply
 
Thread Tools Display Modes
  #1  
Old 02-29-2004, 07:05 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Thumbs up movies to buttons, need help


I am new to vb and i have put movie on a page (windows media player) . If anyone could help me to make it not visible until i click the button i assigned it too. Thx n advance
Reply With Quote
  #2  
Old 02-29-2004, 07:09 PM
Bljashinsky's Avatar
Bljashinsky Bljashinsky is offline
Senior Contributor
 
Join Date: Nov 2003
Location: California
Posts: 1,016
Default Just put its visisble property to false

I am not sure if you don't want it playing or you just don't want the control visible at all. Ally ou have to do for the later part of that is set the visible property of the player to false.
__________________
Check out my website:
Reimagine Memories
Reply With Quote
  #3  
Old 02-29-2004, 07:20 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

i know about visible and not, i am doing a program about ford zx2, and one of my buttons is pictures of dyno and i have on the design page a windows media player that plays the dyno mpeg. I want the " dyno movie " button to play it when I click it but, once it is done playing, i want it to go away.
Reply With Quote
  #4  
Old 02-29-2004, 07:28 PM
Bljashinsky's Avatar
Bljashinsky Bljashinsky is offline
Senior Contributor
 
Join Date: Nov 2003
Location: California
Posts: 1,016
Default Ok just set

Ok gotcha now. After searching the forum found this thread http://www.xtremevbtalk.com/show...=windows+media Try searching the forum next time but alot of people don't so I don't want to yell at you about it.
__________________
Check out my website:
Reimagine Memories
Reply With Quote
  #5  
Old 02-29-2004, 07:38 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

i read but really didn't help me out much for my situation but I dunno :"( so confused =[
Reply With Quote
  #6  
Old 02-29-2004, 07:49 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

Code:
Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long) If OldState = mpPlaying And NewState = mpStopped Then MsgBox "Stopped" End If End Sub
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #7  
Old 02-29-2004, 07:52 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

john, so that is the code for when i click " dyno movie" button it will play it and then disappear?
Reply With Quote
  #8  
Old 02-29-2004, 07:54 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

No. That is code that shows you how to find out when the movie has stopped, it seemed to be the biggest problem you were having. I was hoping you would take that and then try to figure out how to actually hide it.

I was attempting to nudge you in the right direction without giving you the complete code.

Press F2, then in the left hand side click the listing for MediaPlayer, on the right you will see all the properties, events, and methods of that control.
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #9  
Old 02-29-2004, 07:59 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

can't currenly work on it cause i'm at home and my vb is at school on comp but, what i can remember i did on my dyno move button is follows
Private Sub Button5_Clicked(ByVal OldState As Long, ByVal NewState As Long)
mpegDynoMovevisible. = true
End Sub

that was my bet guess on it caus i know to show a picture from a button you do imgMYimagevisible. = true , so i thoughy maybe same code?
Reply With Quote
  #10  
Old 02-29-2004, 08:01 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

after it showed the video i was also trying to make it disappear again unless the " user " clicked the button again, this is my 2nd using VB so I know i sound newbish sir~
Reply With Quote
  #11  
Old 02-29-2004, 08:05 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default



I guess I misunderstood what you were trying to do. To make it play when you click a button do this:
Code:
Private Sub Command1_Click() MediaPlayer1.FileName = PathToFile MediaPlayer1.Play End Sub
And to completely hide it until that point you will need to put the control inside a PictureBox and hide/show the PictureBox through code.

Code:
Option Explicit Private Sub Command1_Click() MediaPlayer1.FileName = PathToFile Picture1.Visible = True MediaPlayer1.Play End Sub Private Sub Form_Load() Picture1.Visible = False End Sub Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long) If OldState = mpPlaying And NewState = mpStopped Then Picture1.Visible = False End If End Sub
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #12  
Old 02-29-2004, 08:09 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Lightbulb

i see you say " picturebox" , the control inside a picturebox? , what i have done to show the mpeg is added the windows media player to my toolbox and the made the size i wished for in the design page, then turned visible= false, what's the picturebox u speak of ^_^


john is very knowledgable, teach me lot, don't know how to repay unless you play broodwar ~ then I could train you but hrm~
Reply With Quote
  #13  
Old 02-29-2004, 08:12 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

The picturebox control, also in your toolbox by default (at the top), can act as a container for other controls. In this case simply saying MediaPlayer1.Visible = False is not enough to completely hide the control. If you cut the control (select it Ctrl+X) and paste it inside the PictureBox (select it Ctrl+V) then you will be able to completely hide the MediaPlayer control by making the PictureBox.Visible = False as I did in the above example.
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #14  
Old 02-29-2004, 08:15 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

AHhhh! I'm catching on ^^
Reply With Quote
  #15  
Old 02-29-2004, 08:18 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

Private Sub Command1_Click()
MediaPlayer1.C:\desktop\marcus\zx2_312hp_283trq_.mpeg = PathToFile
Picture1.Visible = True
MediaPlayer1.Play
End Sub

Private Sub Form_Load()
Picture1.Visible = False
End Sub

Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long)
If OldState = mpPlaying And NewState = mpStopped Then
Picture1.Visible = False
End If
End Sub
Reply With Quote
  #16  
Old 02-29-2004, 08:19 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

yes / no? correct?, im doing this out of memory of the computer and the vb program @ school so may be so/so
Reply With Quote
  #17  
Old 02-29-2004, 08:25 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

Um no. You messed up the FileName part. Compare what you wrote to what I wrote and you will see the difference. *hint* PathToFile is a variable.

Just write it down, or print it out, and bring it to school and try it. We can't sit here and test what you write on our computers just to tell you if it works or not.
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #18  
Old 02-29-2004, 08:27 PM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

yep your right , i'm just hooked on this vb since I got it, very addicting, I'll work on it tomorrow morning, thanks john for your assistance.
Reply With Quote
  #19  
Old 02-29-2004, 08:32 PM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

Cheers
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #20  
Old 03-01-2004, 06:27 AM
JeetDou- JeetDou- is offline
Freshman
 
Join Date: Feb 2004
Posts: 25
Default

k this isn't working to well anyone can help me?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Focus to Radio Buttons? Agent707 General 5 01-14-2004 12:12 PM
How many command buttons are too many on a form? Scanbid Interface and Graphics 15 12-30-2003 12:09 PM
Deleting Buttons based on location Shane_CU Excel 3 07-31-2003 08:19 AM
Enable/Disable buttons in a different form caryatnid General 27 02-26-2003 03:13 PM
2 separate frames, each w/4 radio buttons - need help w/single kept selection Juanita General 22 06-16-2002 01:46 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
movies to buttons, need help
movies to buttons, need help
movies to buttons, need help movies to buttons, need help
movies to buttons, need help
movies to buttons, need help
movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help movies to buttons, need help
movies to buttons, need help
movies to buttons, need help
 
movies to buttons, need help
movies to buttons, need help
 
-->