VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Configure Serial Port "
   ClientHeight    =   2625
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   3465
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   2625
   ScaleWidth      =   3465
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton Command1 
      Caption         =   "Cancel"
      Height          =   495
      Index           =   1
      Left            =   1800
      TabIndex        =   4
      Top             =   2040
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Height          =   855
      Index           =   0
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   3255
      Begin VB.TextBox Text1 
         Height          =   375
         Index           =   0
         Left            =   2280
         TabIndex        =   3
         Text            =   "Text1"
         Top             =   300
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "Serial Port Number"
         Height          =   375
         Index           =   0
         Left            =   360
         TabIndex        =   2
         Top             =   360
         Width           =   1575
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "OK"
      Height          =   495
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   2040
      Width           =   1575
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click(Index As Integer)

    Select Case Index
        Case 0 ' OK
            If IsNumeric(Text1(0).Text) Then
                If Text1(0).Text > 0 And Text1(0).Text < 10 Then
                    
                    frmMain.comSerial1.CommPort = CInt(Text1(0).Text)
                    Else
                    Call MsgBox("Serial Port Entered Out of Limits", vbCritical, "Port Error!")
                    Exit Sub
                End If
            Else
                Call MsgBox("Serial Port Entered Not Valid", vbCritical, "Port Error!")
                Exit Sub
            End If
        Case 1 ' Cancel
            Unload Me
            Exit Sub
    End Select
    
    Unload Me
End Sub



Private Sub Form_Load()
    Text1(0).Text = frmMain.comSerial1.CommPort
End Sub
