-1

The maze game I have developed via a tutorial I found by research is doing well. Step by step I have been debugging this application for Windows using VB in Visual Studio 2012. I was told by the tutorial to use the following code:

Private Sub MoveToStart()
    startSoundPlayer.Play()
    Dim startingPoint = Panel1.Location
    startingPoint.Offset(10, 10)
    Cursor.Position = PointToScreen(startingPoint)
End Sub

On the line startSound.Play() Visual Basic gives me an error message saying: Error Correction Options. So I click on this and it tells me:

'startSoundPlayer' is not declared. It may be inaccessible due to its security level.

What do I do to fix this?

SysDragon
  • 9,193
  • 15
  • 53
  • 86
Alex Stack
  • 41
  • 2
  • 2
  • 7

1 Answers1

1

Declare:

Private startSoundPlayer = New System.Media.SoundPlayer("C:\Windows\Media\chord.wav")

As the tutorial says. In the same Class that the MoveToStart Method. If still fails, declare startSoundPlayer as Public instead of Private.

SysDragon
  • 9,193
  • 15
  • 53
  • 86