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