C
Chris Dunaway
Obviously it would be easier if there was just one subroutine
containing the code and that sub would be called from the If in the open
routine and from the stop routine.
Why not just do as you said in your post and put the code to stop playback
in a separate subroutine and call that from both places:
Private Sub StopPlayback()
If bPlaying Then
'Code to stop playback here
End If
End Sub
Private Sub OpenFile()
StopPlaying
'Other code here
End Sub
Private Sub StopButton_Click(...) Handles StopButton.Click
StopPlayback
End Sub
You can call the PerformClick method but if there are more than one handler
attached, they will all be executed. This is the most logical way, IMHO.
Regards,
--
Chris
dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.