PDA

Click to See Complete Forum and Search --> : Final APP tell me what you think


ZueS
Jan 20th, 2010, 06:05 AM
Alright here is my final result of my test app I made for my very first time.

Tell me what you think. :)

Public Class Form1
Dim r As New Random

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
Timer1.Interval = 100
Label1.Text = "0"
Label1.Text = r.Next(1, 20).ToString
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim op As Double
If TextBox1.Text = Label1.Text Then
MsgBox("You guessed right!")
For op = 100.0 To 0.0 Step -0.01
Me.Opacity = op
Application.DoEvents()
Next
For op = 0.0 To 100.0 Step 0.01
Me.Opacity = op
Application.DoEvents()
Next
Else
MsgBox("You guessed wrong!, Please guess again")
Label1.Text = r.Next(1, 20).ToString
For op = 100.0 To 0.0 Step -0.01
Me.Opacity = op
Application.DoEvents()
Next
For op = 0.0 To 100.0 Step 0.01
Me.Opacity = op
Application.DoEvents()
Next
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Label4.ForeColor = Color.Red Then
Label4.ForeColor = Color.Lime
ElseIf Label4.ForeColor = Color.Lime Then
Label4.ForeColor = Color.Blue
ElseIf Label4.ForeColor = Color.Blue Then
Label4.ForeColor = Color.Red
End If
End Sub
End Class

Credits to:

Some people on the forums for teaching me random functions, And how to change the Opacity of the form to 0.0 back to 100.0 in about a second when, guessed wrong and right!

Thanks,
Cody.

Nightwalker83
Jan 22nd, 2010, 08:18 PM
Could you please wrap your code in tags to make it easier for people to read! Also could you mention which language and version you are using, thank you!