VERSION 5.00
Object = "{E48EFDBF-5838-4A7D-95DD-BC0EC914BD4A}#1.1#0"; "StarCEComponents.ocx"
Begin VB.Form formChooseDevice 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Choose Printer"
   ClientHeight    =   2985
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4725
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2985
   ScaleWidth      =   4725
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton CommandContinue 
      Caption         =   "Continue"
      Enabled         =   0   'False
      Height          =   375
      Left            =   2400
      TabIndex        =   2
      Top             =   2520
      Width           =   2175
   End
   Begin StarCEComponents.EnumPrinters EnumPrinters1 
      Height          =   1575
      Left            =   120
      TabIndex        =   0
      Top             =   840
      Width           =   4455
      _ExtentX        =   7858
      _ExtentY        =   2778
   End
   Begin VB.Label Label1 
      Caption         =   "Please select a printer to configure"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   4455
   End
End
Attribute VB_Name = "formChooseDevice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub CommandContinue_Click()

    ' Display a message if no printer has been selected
    If Me.EnumPrinters1.SelectedPrinterName = "" Then
        MsgBox "Please select a printer first"
        Exit Sub
    End If
    
    ' Save the printer queue name into the global variable and then load the configuration form and unload this one
    Globals.PrinterQueueName = Me.EnumPrinters1.SelectedPrinterName
    formMain.Show
    Unload Me
    
End Sub

Private Sub EnumPrinters1_Changed(QueueName As String)
    ' Change the status of the 'Continue' button. depending on the selected printer name
    
    If QueueName = "" Then
        Me.CommandContinue.Enabled = False
    Else
        Me.CommandContinue.Enabled = True
    End If
    
End Sub

Private Sub Form_Load()
    
    ' By default, no printer will be selected, therefore disable the continue button
    Me.CommandContinue.Enabled = False
    
End Sub

