VERSION 5.00
Begin VB.Form frmInputBox 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "InputBox"
   ClientHeight    =   1800
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5355
   Icon            =   "InputBox.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1800
   ScaleWidth      =   5355
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdButton 
      Caption         =   "&Cancel"
      Height          =   335
      Index           =   1
      Left            =   4300
      TabIndex        =   2
      Top             =   560
      Width           =   910
   End
   Begin VB.CommandButton cmdButton 
      Caption         =   "&OK"
      Height          =   335
      Index           =   0
      Left            =   4300
      TabIndex        =   1
      Top             =   145
      Width           =   910
   End
   Begin VB.TextBox txtInput 
      Height          =   285
      Left            =   120
      TabIndex        =   0
      Top             =   1360
      Width           =   5090
   End
   Begin VB.Label lblPrompt 
      AutoSize        =   -1  'True
      Height          =   195
      Left            =   120
      TabIndex        =   3
      Top             =   120
      Width           =   45
      WordWrap        =   -1  'True
   End
End
Attribute VB_Name = "frmInputBox"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

' You have a royalty-free right to use, modify, reproduce and distribute
' the Sample Application Files (and/or any modified version) in any way
' you find useful, provided that you agree that Martin Liss has no warranty,
' obligations or liability for any Sample Application Files.

' To use this form, you can access its objects directly or through the form's
' properties. The following are the properties
 
'   frmInputBox.ButtonClicked   ' Returns vbOK or vbCancel depending on the button clicked
'   frmInputBox.Default         ' Returns/sets the initial value for user input
'   frmInputBox.Display         ' Show the form modally
'   frmInputBox.PasswordProtect ' Returns/sets whether characters typed by the user are protected
                                ' by asterisks. (If this is set to True, it doesn't make sense
                                ' to set the Default property.
'   frmInputBox.Prompt          ' Set the InputBox Prompt value
'   frmInputBox.Title           ' Set the InputBox Caption value

Private m_intButtonClicked As Integer
Private m_bProtect As Boolean
Private m_strPrompt As String
Private m_strTitle As String
Private m_strDefault As String

' Change these if you modify this form
Private Const FORM_HEIGHT = 2175
Private Const INPUT_TOP = 1360
Private Const PROMPT_WIDTH = 4095
Private Const PROMPT_HEIGHT = 1215

Private Enum btnButtons
    btnOK
    btnCancel
End Enum



Private Sub cmdButton_Click(Index As Integer)

    Select Case Index
        Case btnOK
            ButtonClicked = vbOK
        Case btnCancel
            ButtonClicked = vbCancel
    End Select
    
    Me.Hide

End Sub

Private Sub Form_Activate()
    
    ' Reset the form and it's controls to their original size and positions
    ' if they have been changed (below) by a long prompt.
    Me.Height = FORM_HEIGHT
    lblPrompt.Height = PROMPT_HEIGHT
    txtInput.Top = INPUT_TOP
    
    If PasswordProtect Then
        txtInput.PasswordChar = "*"
    End If
    
    lblPrompt = Prompt
    Me.Caption = Title
    txtInput = Default

    ' Modify the form if a long prompt needs to be displayed.
    lblPrompt.Width = PROMPT_WIDTH
    If lblPrompt.Height > PROMPT_HEIGHT Then
        Me.Height = Me.Height + (lblPrompt.Height - PROMPT_HEIGHT)
        txtInput.Top = txtInput.Top + (lblPrompt.Height - PROMPT_HEIGHT)
    End If
    
    ' Highlight the text in txtInput
    txtInput.SelStart = 0
    txtInput.SelLength = Len(txtInput)
    txtInput.SetFocus

End Sub

Public Sub Display()

    Me.Show 1
    
End Sub

Public Property Get ButtonClicked() As Integer

    ButtonClicked = m_intButtonClicked

End Property

Private Property Let ButtonClicked(ByVal intButton As Integer)

    m_intButtonClicked = intButton

End Property

Public Property Get PasswordProtect() As Boolean

    PasswordProtect = m_bProtect

End Property

Public Property Let PasswordProtect(ByVal bProtect As Boolean)

    m_bProtect = bProtect
    
End Property

Private Property Get Prompt() As String

    Prompt = m_strPrompt

End Property

Public Property Let Prompt(ByVal strPrompt As String)

    m_strPrompt = strPrompt
    
End Property
Private Property Get Title() As String

    Title = m_strTitle

End Property

Public Property Let Title(ByVal strTitle As String)

    m_strTitle = strTitle
    
End Property
Public Property Get Default() As String

    Default = m_strDefault

End Property

Public Property Let Default(ByVal strDefault As String)

    m_strDefault = strDefault
    
End Property

