Hi I'm pretty new to using VB and needed some help with a project I'm working on. I'm trying to create a virtual piano using pictureboxes to represent keys that play .wav file versions of notes. I've gotten this to work fine; however, I'm having trouble with two features I want to implement.
The first feature is to be able to save what I play in a text file. I thought I could use this code but I'm getting an error.
Dim swSong As IO.StreamWriter = IO.File.CreateText("song.txt")
If PictureBox1_click Then
swSong.WriteLine("C") 'The note represented by PictureBox1
End If
swSong.Close()
The second feature is to play random keys using the random class. Is there any way I could store the pictureboxes in an array and then use the random class?
Thanks!
The first feature is to be able to save what I play in a text file. I thought I could use this code but I'm getting an error.
Dim swSong As IO.StreamWriter = IO.File.CreateText("song.txt")
If PictureBox1_click Then
swSong.WriteLine("C") 'The note represented by PictureBox1
End If
swSong.Close()
The second feature is to play random keys using the random class. Is there any way I could store the pictureboxes in an array and then use the random class?
Thanks!