PDA

Click to See Complete Forum and Search --> : Lucky Eight Ball


jamieoliver22
May 5th, 2005, 03:03 AM
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:

Private Sub cmdAsk_Click()
Form1.Hide
Form2.Show
End Sub

Private Sub Form_Terminate()
Unload Form2
Unload Form1
End Sub


Form2:

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
May 15th, 2005, 07:00 PM
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 (http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=22222&lngWId=1) or here (http://sourcesearch2.homestead.com/)).
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.