VB question

Discussion in 'Visual Basic ( VB )' started by 7flint7, Oct 14, 2008.

  1. 7flint7

    7flint7 New Member

    Joined:
    Jun 25, 2008
    Messages:
    24
    Likes Received:
    1
    Trophy Points:
    0
    in my programming class we r making a simple game.
    the point of the game is to press as many buttons as possible in sertain amount of time,
    X is represented as the buttons. but idk how to assign the buttons to be X. there are currently 20 buttons atm.
    some of the code and 1 button as following:

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    If x < 10 Then
    Form2.Visible = True
    Me.Timer1.Stop()
    Me.Timer2.Stop()


    End If
    End Sub
    -----------------------------------------------------------------------
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
    If x > 10 Then
    Form3.Visible = True
    Me.Timer1.Stop()
    Me.Timer2.Stop()

    End If
    End Sub
    -----------------------------------------------------------------------------
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles Button1.Click
    Button1.Dispose()
     
  2. oogabooga

    oogabooga New Member

    Joined:
    Jan 9, 2008
    Messages:
    115
    Likes Received:
    11
    Trophy Points:
    0
    Surely you can explain your problem better than that!
    For example, this:
    "X is represented as the buttons."
    is senseless, along with things like "r", "idk",
    and "atm" (do you need cash?).
     
  3. mbshinde78

    mbshinde78 New Member

    Joined:
    Sep 9, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    Why not give us your source code whatever written?

    If you have written game logic then please give it to us too.

    Cheers
     
  4. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Your query is very vague, please post your code.
     
  5. 7flint7

    7flint7 New Member

    Joined:
    Jun 25, 2008
    Messages:
    24
    Likes Received:
    1
    Trophy Points:
    0
    i did put the code.
    that is all i have i havent been able to move foward with out letting the application know that the buttons represent X. ill repost the entire code when i use the computer which i made the game on. im new at this and its a class work/mini project...
    i shall repose the code asap. thank you
     
  6. 7flint7

    7flint7 New Member

    Joined:
    Jun 25, 2008
    Messages:
    24
    Likes Received:
    1
    Trophy Points:
    0
    code:

    Code:
    Public Class Form1
    
        Dim x As Integer
        Dim button(19) As Application
    
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            If x < 10 Then
                Form2.Visible = True
                Me.Timer1.Stop()
                Me.Timer2.Stop()
    
    
            End If
        End Sub
        Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
            If x > 10 Then
                Form3.Visible = True
                Me.Timer1.Stop()
                Me.Timer2.Stop()
    
            End If
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Button1.Dispose()
    
    
    
    
    
    
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Button2.Dispose()
    
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Button3.Dispose()
    
        End Sub
    
        Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
            Button4.Dispose()
    
        End Sub
    
        Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
            Button5.Dispose()
    
        End Sub
    
        Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
            Button6.Dispose()
    
        End Sub
    
        Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
            Button7.Dispose()
    
        End Sub
    
        Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
            Button8.Dispose()
    
        End Sub
    
        Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
            Button9.Dispose()
    
        End Sub
    
        Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
            Button10.Dispose()
    
        End Sub
    
        Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
            Button11.Dispose()
    
        End Sub
    
        Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
            Button12.Dispose()
    
        End Sub
    
        Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
            Button13.Dispose()
    
        End Sub
    
        Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
            Button14.Dispose()
    
        End Sub
    
        Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
            Button15.Dispose()
    
        End Sub
    
        Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
            Button16.Dispose()
    
        End Sub
    
        Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
            Button17.Dispose()
    
        End Sub
    
        Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
            Button18.Dispose()
    
        End Sub
    
        Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
            Button19.Dispose()
    
        End Sub
    
        Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
            Button20.Dispose()
    
        End Sub
    End Class
     
    Last edited by a moderator: Oct 16, 2008

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice