# VBForums UtilityBank > UtilityBank - Other >  Lucky Eight Ball

## jamieoliver22

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:
Private Sub cmdAsk_Click()
    Form1.Hide
    Form2.Show
End Sub
 Private Sub Form_Terminate()
    Unload Form2
    Unload Form1
End Sub

Form2:

VB Code:
Private Sub cmdAnswer_Click()
    lblAnswer.Visible = True
    cmdAnswer.Visible = False
    cmdReplay.Visible = True
End Sub
 Private Sub cmdReplay_Click()
    Form2.Hide
    Form1.Show
    cmdAnswer.Visible = True
    lblAnswer.Visible = False
    cmdReplay.Visible = False
    Form1.txtQuestion.Text = ""
End Sub
 Sub Form_Activate()
Randomize Timer
With List1
    .AddItem "Yes!"
    .AddItem "No!"
    .AddItem "Of Course!"
    .AddItem "Nope!"
    .AddItem "Never!"
    .AddItem "Yup!"
    .AddItem "Don't count on it!"
    .AddItem "The outlook is good!"
    .AddItem "50-50 chance!"
    .AddItem "Mabye!"
    .AddItem "Only in your dreams!"
    .AddItem "One will never know!"
    .AddItem "I don't know!"
End With
List1.ListIndex = Rnd * List1.ListCount
lblAnswer.Caption = List1.Text
     lblAnswer.ForeColor = vbWhite
    lblAnswer.BackColor = vbBlack
    lblAnswer.FontSize = "12"
    lblAnswer.FontBold = True
    Form2.lblQuestion.Caption = Form1.txtQuestion.Text
    lblQuestion.FontSize = "11"
    lblQuestion.FontBold = True
    
    
End Sub
 Private Sub Form_Terminate()
    Unload Form1
    Unload Form2
End Sub

----------


## si_the_geek

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._

----------

