"语句在一个命名空间和QUOT有效;错误消息语句、错误、有效、消息

2023-09-04 06:21:50 作者:你本来就很美i

我有一个有点problem..For某种原因Visual Studio中说,有一个错误 - 记载:

I Have a bit of a problem..For some reason visual studio says there's an error--it reads:

声明是无效的命名空间

我不知道如何解决它。这是我的codeD样子,有一个蓝色的波浪行的前两行开始的私人小组:

I can't figure out how to fix it. This is what my coded looks like and there's a blue squiggly line on the first two lines that start with Private Sub:

Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlay.Click

'This procedure Starts the timer (progress bar) when the user clicks Play
'and it starts the game
Timer1.Start()
btnPlay.Enabled = True
picMainPage.Visible = False

End Sub

我希望有人能帮助,我在这个新的,我一直坚持这个错误已经三天... :(我试着从不同的事情,将末级到$年底C $ C到重新知晓的codeD,但我不断收到同样的错误消息。

I hope someone can help, I'm new at this and I've been stuck with this error for three days now... :( I've tried various things from, adding END CLASS to the end of the code to re-witting the coded but I keep getting the same error message.

推荐答案

您需要把方法内的类的(或模块或结构),而不是直接在命名空间。

You need to put methods within a class (or module or structure), not directly in a namespace.

请参阅 MSDN上的Visual Basic程序的结构。