The Multimedia ControlDespite its power, the multimedia control is extremely simple to use. You'll write only a small amount of code to use the it. With the multimedia control, you'll be able to embed objects that represent the following simple multimedia devices:
You can also embed objects that represent the following compound multimedia devices:
Obviously, the PC on which your multimedia applications run must support standard multimedia devices, such as sound, graphics, and video, as well as have a CD-ROM drive (or a compatible device, such as a DVD drive). Applying the ControlAs with the common dialog box control, you must add the multimedia control to your toolbox window, because the standard toolbox does not list the multimedia control. To do this, press Ctrl+T to display the Components dialog box and select the control labeled Microsoft Multimedia Control 6.0. When you click OK, Visual Basic adds the control as the last tool on your toolbox window. When you place the multimedia control on a form, a familiar set of buttons appear: These buttons mimic the ones that control your VCR or cassette tape player (see Figure 14.8). The multimedia control produces this set of multimedia device buttons. The multimedia control is an intelligent control that recognizes the capabilities of the devices you attach to it. Therefore, the Play button will not be active if you've ejected a CD from the CD-ROM drive. Of course, you have complete control, through various property value settings, over which buttons appear on the control. Instead of having an inactive Record button appear on the multimedia control when playing audio CDs (which cannot be recorded over), you'll want to completely hide the Record button.
The multimedia control contains a list of devices with preselected buttons, so you don't have to specifically select individual buttons to appear on each control. The multimedia control supports a property called DeviceType that, when you initialize it with the device you want to use (such as the value of CDAudio, which specifies that you want the multimedia control to control an audio CD), the multimedia control automatically enables the correct buttons. The list of supported devices presented at the beginning of the previous section lists all the values allowed in the DeviceType property. Your job is to tell the application that the multimedia control is to be a CD audio player; then the multimedia control takes care of setting up the correct buttons. As with many of the more involved controls, such as the common dialog box control, the multimedia control includes a (Custom) entry in the Properties window that you can select to display a dialog box that simplifies selecting properties. For example, if you click the Controls tab, the dialog box page shown in Figure 14.9 appears. From here, you can customize exactly which buttons appear on the control. You can also check if you want to display or enable any button on the control. The Properties window's (Custom) entry makes selecting properties, such as the visible buttons, simple.
|
|
![]() |
![]() |
|||