The order of adding sounds to the form is as follows:
Tools-Options-Control-ActiveX Control, select "Microsoft media player" in the selected dialog box, and confirm to exit the interface; < /p>
Select "ActiveX Control" in the toolbar, select the "Microsoft media player" control, and left-click the mouse on the form, thus creating the "Microsoft media player" object;
Add the following statement to the form to play the sound:
thisform.olecontrol1.open(〃sound.wav〃)
playcount can be used to control the number of plays;
Add the statement: this.play to the EndOf Stream Event to achieve repeated playback.
In the above "sound.wav", .wav .avi can be freely changed according to your sound file type.
I have a completed form, you can tell me if you need it.