Lucky Eight Ball-VBForums
Results 1 to 2 of 2

Thread: Lucky Eight Ball

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    37

    Lucky Eight Ball

    Hi all!

    I have just finished an 8ball program.
    Its really basic but i would just like to see what you think about it.

    This is my 1st proper program as i am a noob at VB

    Any way i hope you like it!

    J


    Code:

    Form1:
    VB Code:
    1. Private Sub cmdAsk_Click()
    2.     Form1.Hide
    3.     Form2.Show
    4. End Sub
    5.  
    6. Private Sub Form_Terminate()
    7.     Unload Form2
    8.     Unload Form1
    9. End Sub

    Form2:
    VB Code:
    1. Private Sub cmdAnswer_Click()
    2.     lblAnswer.Visible = True
    3.     cmdAnswer.Visible = False
    4.     cmdReplay.Visible = True
    5. End Sub
    6.  
    7. Private Sub cmdReplay_Click()
    8.     Form2.Hide
    9.     Form1.Show
    10.     cmdAnswer.Visible = True
    11.     lblAnswer.Visible = False
    12.     cmdReplay.Visible = False
    13.     Form1.txtQuestion.Text = ""
    14. End Sub
    15.  
    16. Sub Form_Activate()
    17. Randomize Timer
    18. With List1
    19.     .AddItem "Yes!"
    20.     .AddItem "No!"
    21.     .AddItem "Of Course!"
    22.     .AddItem "Nope!"
    23.     .AddItem "Never!"
    24.     .AddItem "Yup!"
    25.     .AddItem "Don't count on it!"
    26.     .AddItem "The outlook is good!"
    27.     .AddItem "50-50 chance!"
    28.     .AddItem "Mabye!"
    29.     .AddItem "Only in your dreams!"
    30.     .AddItem "One will never know!"
    31.     .AddItem "I don't know!"
    32. End With
    33. List1.ListIndex = Rnd * List1.ListCount
    34. lblAnswer.Caption = List1.Text
    35.  
    36.     lblAnswer.ForeColor = vbWhite
    37.     lblAnswer.BackColor = vbBlack
    38.     lblAnswer.FontSize = "12"
    39.     lblAnswer.FontBold = True
    40.     Form2.lblQuestion.Caption = Form1.txtQuestion.Text
    41.     lblQuestion.FontSize = "11"
    42.     lblQuestion.FontBold = True
    43.    
    44.    
    45. End Sub
    46.  
    47. Private Sub Form_Terminate()
    48.     Unload Form1
    49.     Unload Form2
    50. End Sub
    Attached Files Attached Files
    Last edited by si_the_geek; May 15th, 2005 at 06:58 PM. Reason: added code (sent via pm)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.