' DiceModuleTest.vb
' Demonstrates modDiceModule procedures
    Imports System.Drawing

Public Class FrmDiceModuleTest
    Inherits System.Windows.Forms.Form
    Friend WithEvents lblSum As Label ' displays 10-roll sum
    Friend WithEvents diceGroup As GroupBox
    ' dice images
    Friend WithEvents picDie1 As PictureBox
    Friend WithEvents picDie2 As PictureBox
    Friend WithEvents cmdRollDie1 As Button ' rolls blue die
    Friend WithEvents cmdRollTen As Button  ' simulates 10 rolls
    Friend WithEvents cmdRollDie2 As Button ' rolls red die
    ' Visual Studio .NET generated code

    Private Sub cmdRollDie1_Click(ByVal sender As System.Object, _
             ByVal e As System.EventArgs) Handles cmdRollDie1.Click

        picDie1.Image = modDice.GetDieImage(modDice.RollDie())
    End Sub ' cmdRollDie1_Click

    Private Sub cmdRollDie2_Click(ByVal sender As System.Object, _
             ByVal e As System.EventArgs) Handles cmdRollDie2.Click

        picDie2.Image = modDice.GetDieImage(modDice.RollDie(), "redDie")
    End Sub ' cmdRollDie2_Click
    Private Sub cmdRollTen_Click(ByVal sender As System.Object, _
             ByVal e As System.EventArgs) Handles cmdRollTen.Click

        lblSum.Text = Convert.ToString(modDice.RollAndSum(10))
    End Sub ' cmdRollTen_Click

End Class ' FrmDiceModuleTest   

