hhe, hello!! Good day!
Can I ask a favor for the software that I am making?
please help me, hhe,
I have 10 forms to run randomly , the names of each form is from
Easy1, Easy2……………………Easy10
And this randomnation will start when I click the start button,
well considerably, I really have to have 30 forms for the software, and the 10 forms that I am asking here with you all guys, is the forms that will run when I click the easy button to execute the easy forms to start the quiz, the other 20 forms is divided on the 2 buttons which is the “Normal”, and the “Hard”, hhe, I also have another button that will run all of the 30 forms with its name of “Play ALL”, and what I need is the code for all of it,
I need them all to execute and run randomly, without repetition,
and on every forms or questions, it haves 3 lives that when I clciked the wrong button, it will less to the 3 lives until it gets to zero and open the Game Over button, that will again start at the beginning.
here is one of the form, I have
And the code
Public Class Quiz1a
Const QuestionCount As Integer = 10
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim QuestionList As List(Of Integer) = GenerateUnique(QuestionCount, 1, QuestionCount)
For Each x As Integer In QuestionList
Dim frm As Form = DirectCast(Activator.CreateInstance(Type.GetType(String.Format("{0}.{1}{2}", "software", "Easy", x))), Form)
frm.ShowDialog()
Next
End Sub
Private Shared Function GenerateUnique(ByVal LoopCount As Integer, ByVal rMin As Integer, ByVal rMax As Integer) As List(Of Integer)
Dim holder As New HashSet(Of Integer)
Dim rand As New Random
Do
holder.Add(rand.Next(rMin, rMax + 1))
Loop Until holder.Count = 10
Return holder.ToList
End Function
End Class
Public Class Easy1
Public Count As Integer
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
score += 5
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End Sub
Private Sub Easy1_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Count = Label2.Text
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End Sub
End Class