"语句在一个命名空间和QUOT有效;错误消息 [英] "Statement is not valid in a namespace" error messaging

查看:147
本文介绍了"语句在一个命名空间和QUOT有效;错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有点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程序的结构。

这篇关于"语句在一个命名空间和QUOT有效;错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆