By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

Minmize Media Player on ESC Button Press

P: 95
I have two buttons Play & Full Screen. If u click on Play Button,Movie starts..Movie Starts within 15-20 Seconds.....When u clik on Full Screen Button.,Media Player is Maximised. I want the if the media player is maximised,& when we click on ESC Button, Media player is minimsed.......But I m nota ble to achiev that.. Secondly I do not know that which event is used for dat KeyPress Or keyDown.. I have used both of these,But None is working/..

Mine Code is as Under.Plz go thru it..& help me it sorting out---

Public Class Form1

Private Sub btnPLAY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPLAY.Click
AxWindowsMediaPlayer1.URL = "http://www.voanews.com/wm/voa/europe/alba/alba1700vb.asx"
End Sub

Private Sub btnFULLSCREEN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFULLSCREEN.Click
AxWindowsMediaPlayer1.fullScreen = True
End Sub


Private Sub AxWindowsMediaPlayer1_KeyDownEvent(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_KeyDownEvent) Handles AxWindowsMediaPlayer1.KeyDownEvent
If e.nKeyCode = Keys.Escape Then
If AxWindowsMediaPlayer1.fullScreen Then
AxWindowsMediaPlayer1.fullScreen = False
End If
End If
End Sub

Private Sub AxWindowsMediaPlayer1_KeyPressEvent(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_KeyPressEvent) Handles AxWindowsMediaPlayer1.KeyPressEvent
If e.nKeyAscii = 27 Then
If AxWindowsMediaPlayer1.fullScreen Then
AxWindowsMediaPlayer1.fullScreen = False
End If
End If
End Sub



End Class
Oct 15 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.