VERSION 5.00
Begin VB.Form frmSerialEntry 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "PPCalc - License Entry"
   ClientHeight    =   1965
   ClientLeft      =   2835
   ClientTop       =   3480
   ClientWidth     =   4650
   Icon            =   "frmSerialEntry.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1965
   ScaleWidth      =   4650
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.TextBox txtName 
      Height          =   315
      Left            =   1290
      TabIndex        =   1
      Top             =   525
      Width           =   3165
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Default         =   -1  'True
      Height          =   390
      Left            =   2070
      TabIndex        =   4
      Top             =   1410
      Width           =   1140
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   390
      Left            =   3315
      TabIndex        =   5
      Top             =   1410
      Width           =   1140
   End
   Begin VB.TextBox txtPassword 
      Height          =   315
      HideSelection   =   0   'False
      IMEMode         =   3  'DISABLE
      Left            =   1290
      TabIndex        =   3
      Top             =   915
      Width           =   3165
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Please enter your name and serial number and press OK."
      Height          =   195
      Left            =   323
      TabIndex        =   6
      Top             =   135
      Width           =   4005
   End
   Begin VB.Label lblLabels 
      AutoSize        =   -1  'True
      Caption         =   "&Name:"
      Height          =   195
      Index           =   0
      Left            =   735
      TabIndex        =   0
      Top             =   570
      Width           =   465
   End
   Begin VB.Label lblLabels 
      AutoSize        =   -1  'True
      Caption         =   "&Serial Number:"
      Height          =   195
      Index           =   1
      Left            =   150
      TabIndex        =   2
      Top             =   960
      Width           =   1035
   End
End
Attribute VB_Name = "frmSerialEntry"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdCancel_Click()
 Unload Me
End Sub

Private Sub cmdOK_Click()

If Len(Trim(txtName.Text)) = 0 Then
 MsgBox "Please enter your name.", vbInformation + vbOKOnly, "PPCalc - Entry Error"
ElseIf Len(Trim(txtPassword.Text)) = 0 Then
 MsgBox "Please enter a valid serial number.", vbInformation + vbOKOnly, "PPCalc - Entry Error"
Else

    If ValidatePassword(txtPassword.Text) = True Then
        MsgBox "Your serial number has been validated." & vbLf & vbLf & "Thank you for your purchase!", vbInformation + vbOKOnly, "Registration Successful"
        SaveSetting "PPCalc", "Settings", "Serial", txtPassword.Text
        SaveSetting "PPCalc", "Settings", "Name", txtName.Text
        Unload Me
    Else
        MsgBox "Serial Number is Invalid.", vbExclamation + vbOKOnly, "Registration Failed"
        txtPassword.SetFocus
        SendKeys "{Home}+{End}"
    End If
    
End If
    
End Sub

Private Sub Form_Load()
If GetSetting("PPCalc", "Settings", "Name") <> "" Then
 txtName.Text = GetSetting("PPCalc", "Settings", "Name")
 txtPassword.TabIndex = 0
End If
End Sub