Error: Statement cannot appear within a method body. [solved]

Posts 1–5 of 5 · Page 1 of 1
Error: Statement cannot appear within a method body. [solved]
Hello MPGHIANS, this is my first time using Visual Basic and when I started using 2010 version it was very different in coding so I went to 2008. I love it a lot more, but the only problem is I get an error and I've searched but can't find much so I'm hoping my family "mpgh" can help me, thanks in advance...


~~Froggy

Error 1 Statement cannot appear within a method body. End of method assumed.

My code that has an error:
Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position )
mouse_event(&H2, 0, 0, 0, 1)
mouse_event(&H4, 0, 0, 0, 1)

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox3.Text = TextBox3.Text + 1
End Sub
Quote Originally Posted by FrogIsHam View Post
Hello MPGHIANS, this is my first time using Visual Basic and when I started using 2010 version it was very different in coding so I went to 2008. I love it a lot more, but the only problem is I get an error and I've searched but can't find much so I'm hoping my family "mpgh" can help me, thanks in advance...


~~Froggy

Error 1 Statement cannot appear within a method body. End of method assumed.

My code that has an error:
Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position )
mouse_event(&H2, 0, 0, 0, 1)
mouse_event(&H4, 0, 0, 0, 1)

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox3.Text = TextBox3.Text + 1
End Sub
Well you probably didn't close your other sub before starting the new one. Post more code from around that area.
You can't put code like that in the middle of nowhere..
Jason thanks for helping me (Thanked)
Problem solved

/Request CLOSE

Jason thanks for helping me (Thanked)
Problem solved

/Request CLOSE
Marked as solved.
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Tags for this Thread

Need help?