Στη Visual Basic το όργανο Microsoft Multimedia Control (το προσθέτουμε από την επιλογή Project - Components) επιτρέπει την εύκολη πρόσβαση σε πολυμέσα. Το όργανο εμφανίζεται με την παρακάτω μορφή:
Για να χρησιμοποιήσουμε το όργανο αυτό ακολουθούμε τα παρακάτω βήματα:
Command | Description |
Open | Opens a device using the MCI_OPEN command. |
Close | Closes a device using the MCI_CLOSE command. |
Play | Plays a device using the MCI_PLAY command. |
Pause | Pauses playing or recording using the MCI_PLAY command. If executed while the device is paused, tries to resume playing or recording using the MCI_RESUME command. |
Stop | Stops playing or recording using the MCI_STOP command. |
Back | Steps backward using the MCI_STEP command. |
Step | Steps forward using the MCI_STEP command. |
Prev | Goes to the beginning of the current track using the Seek command. If executed within three seconds of the previous Prev command, goes to the beginning of the previous track or to the beginning of the first track if at the first track. |
Next | Goes to the beginning of the next track (if at last track, goes to beginning of last track) using the Seek command. |
Seek | If not playing, seeks a position using the MCI_SEEK command. If playing, continues playing from the given position using the MCI_PLAY command. |
Record | Records using the MCI_RECORD command. |
Eject | Ejects media using the MCI_SET command. |
Sound | Plays a sound using the MCI_SOUND command. |
Save | Saves an open file using the MCI_SAVE command. |
Private Sub Form_Load() mcictrl.Notify = False mcictrl.Shareable = False mcictrl.DeviceType = "AVIVideo" mcictrl.filename = "C:\Program Files\Microsoft Office\Clipart\MMedia\globe.AVI" mcictrl.Command = "Open" mcictrl.Wait = True mcictrl.Command = "Play" mcictrl.Command = "Close" mcictrl.filename = "C:\Program Files\Microsoft Office\Clipart\MMedia\sonata8.wav" mcictrl.Command = "Open" mcictrl.Wait = True mcictrl.Command = "Play" mcictrl.Wait = True mcictrl.Command = "Close" End Sub