-
Well I put in a midisequence in my tool box from custiom controls, and I put a song in it in the fourm. It shows
|the midi icon|
| my song |
I have made a menu with a music option, the options in it are
on
off
And I wanted to make it so when you click on on the midi will turn on and when you click off it'll turn off. How can I do that. The name of the midi sequence in the form is midi1.
-
In the toolbar buttonclick event put a boolean switch to go true when false and vice verse
Code:
static switch as boolean
switch=not switch
if switch then
'turn on the midi
else
'turn off the midi
end if
-
You can also use the mciSendString API to play MIDI's, which might be better in your case because you just want ON and OFF features.
Code For module.
Code:
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
To Play the MIDI.
Code:
mciSendString "open C:\MyMidi.mid", 0, 0, 0
mciSendString "play background", 0, 0, 0
To Stop the MIDI
Code:
mciSendString "close background", 0, 0, 0