VERSION 5.00
Begin VB.Form MainDialog 
   Caption         =   "Magn1 Example"
   ClientHeight    =   7020
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4785
   LinkTopic       =   "Form1"
   ScaleHeight     =   7020
   ScaleWidth      =   4785
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame frmInput 
      Caption         =   "Input Data"
      Height          =   2535
      Left            =   120
      TabIndex        =   3
      Top             =   120
      Width           =   3375
      Begin VB.TextBox Ymin 
         Height          =   375
         Left            =   1920
         TabIndex        =   7
         Text            =   "1"
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox YMax 
         Height          =   375
         Left            =   1920
         TabIndex        =   6
         Text            =   "20"
         Top             =   840
         Width           =   1215
      End
      Begin VB.TextBox Step 
         Height          =   375
         Left            =   1920
         TabIndex        =   5
         Text            =   "1"
         Top             =   1320
         Width           =   1215
      End
      Begin VB.TextBox HcValue 
         Height          =   375
         Left            =   1920
         TabIndex        =   4
         Text            =   "147218"
         Top             =   2040
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "Initial Position"
         Height          =   255
         Left            =   120
         TabIndex        =   11
         Top             =   480
         Width           =   1455
      End
      Begin VB.Label Label2 
         Caption         =   "Final Position"
         Height          =   255
         Left            =   120
         TabIndex        =   10
         Top             =   960
         Width           =   1455
      End
      Begin VB.Label Label3 
         Caption         =   "Step"
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   1440
         Width           =   1455
      End
      Begin VB.Label Label4 
         Caption         =   "Coercive Force"
         Height          =   255
         Left            =   120
         TabIndex        =   8
         Top             =   2160
         Width           =   1455
      End
   End
   Begin VB.CommandButton CloseButton 
      Caption         =   "Close"
      Height          =   375
      Left            =   3720
      TabIndex        =   2
      Top             =   1080
      Width           =   975
   End
   Begin VB.CommandButton Start 
      Caption         =   "Start"
      Height          =   375
      Left            =   3720
      TabIndex        =   0
      Top             =   240
      Width           =   975
   End
   Begin VB.Frame Frame1 
      Caption         =   "Calculation Results"
      Height          =   4215
      Left            =   120
      TabIndex        =   1
      Top             =   2760
      Width           =   4575
      Begin VB.TextBox Result 
         BackColor       =   &H00C0E0FF&
         Height          =   3735
         HideSelection   =   0   'False
         Left            =   120
         Locked          =   -1  'True
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   12
         Top             =   360
         Width           =   4335
      End
   End
End
Attribute VB_Name = "MainDialog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Start_Click()
    Result.Text = ""
    DoCalculation HcValue.Text, Ymin.Text, YMax.Text, Step.Text
End Sub

Private Sub CloseButton_Click()
    Unload Me
End Sub

Public Sub DisplayStepResult(ByVal pos As Double, ByVal force As Double)
    Dim str As String
    str = Result.Text
    str = str & vbNewLine & "Pos = " & pos & _
            "   Force = " & FormatNumber(force, 3)
    Result.Text = str
End Sub

