Imports System.IO
Imports System.Windows.Forms

Public Class Form1

    Inherits System.Windows.Forms.Form
    Dim naamArray As String()
    Dim counter As Integer = 0
    Dim getal As Integer = 0
    Dim randomGetal As random = New random


#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()
        pbxAva.Image = Image.FromFile(Directory.GetCurrentDirectory & "\Images\" & "vraag.gif")
        btnNext.Text = "Begin"

        lblInfo.Text = "De avatar-quiz, klik op Begin"

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnOk As System.Windows.Forms.Button
    Friend WithEvents btnNext As System.Windows.Forms.Button
    Friend WithEvents gbxAva As System.Windows.Forms.GroupBox
    Friend WithEvents pbxAva As System.Windows.Forms.PictureBox
    Friend WithEvents cboAva As System.Windows.Forms.ComboBox
    Friend WithEvents lblInfo As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
        Me.btnOk = New System.Windows.Forms.Button
        Me.btnNext = New System.Windows.Forms.Button
        Me.gbxAva = New System.Windows.Forms.GroupBox
        Me.pbxAva = New System.Windows.Forms.PictureBox
        Me.cboAva = New System.Windows.Forms.ComboBox
        Me.lblInfo = New System.Windows.Forms.Label
        Me.gbxAva.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnOk
        '
        Me.btnOk.Location = New System.Drawing.Point(384, 88)
        Me.btnOk.Name = "btnOk"
        Me.btnOk.TabIndex = 0
        Me.btnOk.Text = "&Ok"
        '
        'btnNext
        '
        Me.btnNext.Location = New System.Drawing.Point(384, 136)
        Me.btnNext.Name = "btnNext"
        Me.btnNext.TabIndex = 1
        Me.btnNext.Text = "&Next"
        '
        'gbxAva
        '
        Me.gbxAva.Controls.Add(Me.pbxAva)
        Me.gbxAva.Location = New System.Drawing.Point(8, 8)
        Me.gbxAva.Name = "gbxAva"
        Me.gbxAva.Size = New System.Drawing.Size(224, 248)
        Me.gbxAva.TabIndex = 2
        Me.gbxAva.TabStop = False
        Me.gbxAva.Text = "Avatar"
        '
        'pbxAva
        '
        Me.pbxAva.Cursor = System.Windows.Forms.Cursors.Cross
        Me.pbxAva.Image = CType(resources.GetObject("pbxAva.Image"), System.Drawing.Image)
        Me.pbxAva.Location = New System.Drawing.Point(8, 16)
        Me.pbxAva.Name = "pbxAva"
        Me.pbxAva.Size = New System.Drawing.Size(208, 224)
        Me.pbxAva.TabIndex = 0
        Me.pbxAva.TabStop = False
        '
        'cboAva
        '
        Me.cboAva.AllowDrop = True
        Me.cboAva.Items.AddRange(New Object() {"ace", "billie", "diem", "jak", "kami", "razorken", "staaf", "stompie", "stringske", "swiffer", "xml"})
        Me.cboAva.Location = New System.Drawing.Point(248, 88)
        Me.cboAva.Name = "cboAva"
        Me.cboAva.Size = New System.Drawing.Size(104, 21)
        Me.cboAva.TabIndex = 3
        Me.cboAva.Text = "Avatar"
        '
        'lblInfo
        '
        Me.lblInfo.Location = New System.Drawing.Point(248, 216)
        Me.lblInfo.Name = "lblInfo"
        Me.lblInfo.Size = New System.Drawing.Size(232, 40)
        Me.lblInfo.TabIndex = 4
        Me.lblInfo.Text = "Info"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(496, 273)
        Me.Controls.Add(Me.lblInfo)
        Me.Controls.Add(Me.cboAva)
        Me.Controls.Add(Me.gbxAva)
        Me.Controls.Add(Me.btnNext)
        Me.Controls.Add(Me.btnOk)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.gbxAva.ResumeLayout(False)
        Me.ResumeLayout(False)




    End Sub

#End Region





    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboAva.SelectedIndexChanged

    End Sub

    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gbxAva.Enter

    End Sub

    Private Sub Ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
        If cboAva.SelectedIndex = getal Then
            lblInfo.Text = "Juist!!!"
            btnNext.Enabled = True
            btnOk.Enabled = False
        Else
            lblInfo.Text = "Fout!!!"

        End If
    End Sub

    Private Sub Next_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click

        getal = randomGetal.Next(0, 10)

        naamArray = New String() {"ace", "billie", "diem", "jak", "kami", "razorken", "staaf", "stompie", "stringske", "swiffer", "xml"}
        If btnNext.Text = "Begin" Then
            lblInfo.Text = "Klik op de knop om te beginnen"
        Else
            btnNext.Enabled = False
            btnOk.Enabled = True
        End If
        btnNext.Text = "Next"
        If counter < 11 Then
            lblInfo.Text = "Klik op OK om te controleren"
            pbxAva.Image = Image.FromFile(Directory.GetCurrentDirectory & "\Images\" & naamArray(getal) & ".gif")
            counter = counter + 1
        Else
            lblInfo.Text = "Geen avatars meer."
        End If
        


    End Sub


End Class
