Lucky Eight Ball-VBForums
Results 1 to 2 of 2

Thread: Lucky Eight Ball

  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 05:58 PM. Reason: added code (sent via pm)

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    37,192

    Re: Lucky Eight Ball

    The code/files within this thread (submitted: 5-5-2005) have been checked for malware by a moderator.

    Disclaimer: This does not necessarily mean that any compiled files (DLL/EXE/OCX etc) are completely safe, but any supplied code does not contain any obvious malware. It also does not imply that code is error free, or that it performs exactly as described.

    It is recommended that you manually check any code before running it, and/or use an automated tool such as Source Search by Minnow (available here or here).
    If you find any serious issues (ie: the code causes damage or some sort), please contact a moderator of this forum.

    Usage of any code/software posted on this forum is at your own risk.

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.