Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-04-2012, 07:21 PM   PM User | #1
AqworldThunder
New to the CF scene

 
Join Date: Nov 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
AqworldThunder is an unknown quantity at this point
Identifier Expected? VB

So when I was writing code to a program it gave me a error in the first line that said "Identifier Expected" here is the code to the program.





Code:
Public Class 
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim RND As New Random
        ElectricButton1.Location = New Point(RND.Next(1, 270), RND.Next(1, 270))
    End Sub

    Private Sub ElectricButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ElectricButton1.Click
        If Timer1.Interval = 50 Then MsgBox("You have won!") : End
        MsgBox("FASTER!!")
        Timer1.Interval -= 50 : ToolStripStatus1.Text += 50
    End Sub

    Private Sub ElectricButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ElectricButton2.Click
        ElectricButton1.Show()
        ElectricButton2.Hide()
    End Sub
End Class
AqworldThunder is offline   Reply With Quote
Old 11-05-2012, 03:27 PM   PM User | #2
aljones
New Coder

 
Join Date: Sep 2012
Location: Terlingua, Texas
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
aljones is an unknown quantity at this point
Your class has to have a name ...

Public Class <somename>

Would take care of that error. (obviously replace '<somename>' with the class name of your choice.
aljones is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:30 PM.


Advertisement
Log in to turn off these ads.