|
-
Dec 14th, 2011, 06:57 PM
#1
Thread Starter
New Member
Can I Call a Class from my main form?
Hi,
First of, I'm a beginner, so this is sloppy. My apologizes in advance.
As of the moment I have 24 buttons that are keys to a piano.
24 of the button codes have a call method that calls the note to be played.
24 of the private subs that are called have an .wav audio playback command within them.
I was hoping I could move the .wav private subs into a separate class, and just call them from my main form, therefore cleaning up the lines of code I have at the moment.
Here's a break down:
-----------------
Button Code
----------------
Select Case True
Case sender Is cButton
Call C()
End Select
---------------
Private Sub Code
---------------
Private Sub C()
My.Computer.Audio.Play(My.Resources.C, AudioPlayMode.Background)
End Sub
----------------
That example only counts for one Button "The Key of C", and the audio file that is called with it. Multiply that by 24 and you get a big mess of repetitive junk.
Can I move the audio subs into a class and call them from my main form?
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|