frmMsgBox.vb

 Public Class frmMsgBox
    Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        '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 lblIcon As System.Windows.Forms.Label
    Friend WithEvents lblMsg As System.Windows.Forms.Label
    Friend WithEvents lblOneLiner As System.Windows.Forms.Label
    Friend WithEvents btnOK As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.lblIcon = New System.Windows.Forms.Label
        Me.lblMsg = New System.Windows.Forms.Label
        Me.lblOneLiner = New System.Windows.Forms.Label
        Me.btnOK = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'lblIcon
        '
        Me.lblIcon.AutoSize = True
        Me.lblIcon.Font = New System.Drawing.Font("Arial Black", 48.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblIcon.ForeColor = System.Drawing.Color.Red
        Me.lblIcon.Location = New System.Drawing.Point(8, 0)
        Me.lblIcon.Name = "lblIcon"
        Me.lblIcon.Size = New System.Drawing.Size(45, 94)
        Me.lblIcon.TabIndex = 4
        Me.lblIcon.Text = "!"
        '
        'lblMsg
        '
        Me.lblMsg.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblMsg.Location = New System.Drawing.Point(64, 120)
        Me.lblMsg.Name = "lblMsg"
        Me.lblMsg.Size = New System.Drawing.Size(268, 104)
        Me.lblMsg.TabIndex = 7
        Me.lblMsg.Text = "Put more explanatory text here."
        '
        'lblOneLiner
        '
        Me.lblOneLiner.Font = New System.Drawing.Font("Arial", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblOneLiner.Location = New System.Drawing.Point(60, 32)
        Me.lblOneLiner.Name = "lblOneLiner"
        Me.lblOneLiner.Size = New System.Drawing.Size(188, 64)
        Me.lblOneLiner.TabIndex = 6
        Me.lblOneLiner.Text = "Put one-liner summary here."
        '
        'btnOK
        '
        Me.btnOK.Location = New System.Drawing.Point(196, 224)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.TabIndex = 8
        Me.btnOK.Text = "OK"
        '
        'frmMsgBox
        '
        Me.AcceptButton = Me.btnOK
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.LightSteelBlue
        Me.ClientSize = New System.Drawing.Size(330, 251)
        Me.ControlBox = False
        Me.Controls.Add(Me.btnOK)
        Me.Controls.Add(Me.lblMsg)
        Me.Controls.Add(Me.lblOneLiner)
        Me.Controls.Add(Me.lblIcon)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmMsgBox"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.Text = "frmMsgBox"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private charMsg As String

    Public Sub New(ByVal Title As String, ByVal summary As String, ByVal msg As String, ByVal col As Integer, ByVal min As Integer, ByVal sec As Integer)
        InitializeComponent()
        Me.Text = Title
        lblOneLiner.Text = summary
        lblMsg.Text = msg

        ' Display a message for player
        If col = 1 Then ' If wins
            If min = 0 Then ' Less than a minute
                If sec <= 10 Then
                    charMsg = "Using the ""Show me"" button, it Wouldn't be incredible! heh!"
                End If
                If sec <= 20 And sec > 10 Then
                    charMsg = "Very Good!"
                End If
                If sec <= 30 And sec > 20 Then
                    charMsg = "Good!"
                End If
                If sec <= 45 And sec > 30 Then
                    charMsg = "Thats right!"
                End If
                If sec <= 59 And sec > 45 Then
                    charMsg = "Thats the way it is!"
                End If
            Else
                If min = 1 Then ' Less than 2 minutes
                    If sec <= 15 Then
                        charMsg = "Not bad!"
                    End If
                    If sec <= 30 And sec > 15 Then
                        charMsg = "You can use help to increase your speed!"
                    End If
                    If sec <= 59 And sec > 30 Then
                        charMsg = "Well..."
                    End If
                Else    ' More than 2 minutes
                    charMsg = "You should be faster, check the ""Show me""."
                End If
            End If
        Else    ' If Looses
            charMsg = "Try again!"
        End If

        If col = 0 Then
            lblIcon.ForeColor = Color.Red
        Else
            lblIcon.ForeColor = Color.GreenYellow
        End If
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Me.Close()
    End Sub

    Private Sub frmMsgBox_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
        On Error GoTo Handler
        With Check.Characters("check")
            .MoveTo(Me.Location.X + Me.Width - 150, Me.Location.Y + lblMsg.Top - 90)
            .Speak(charMsg)
        End With
Handler:
        If Err.Number <> 0 Then
            Me.Hide()
            ErrMsg(Err.Source.ToString)
        End If
    End Sub

    Private Sub frmMsgBox_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
        On Error GoTo Handler
        Check.Characters("check").MoveTo(0, Screen.PrimaryScreen.Bounds.Size.Height - 200)
Handler:
        If Err.Number <> 0 Then
            Me.Hide()
            ErrMsg(Err.Source.ToString)
        End If
    End Sub
End Class

Project Homepage: