VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "VBForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Description = "A class written in Visual Basic to illustrate how to use Visual Basic to add functionality to SML."
' ThingDemo
'
' Derived from Chapter 2 of Microsoft Visual Basic 6.0 Component Tools Guide
'   (Volume 3 of the three-volume Microsoft Vusual Basic 6.0 Reference Library)
' This example class defines

Option Explicit

Private WithEvents mDlg As dlgDemo
Attribute mDlg.VB_VarHelpID = -1
Public Event OnApply()
Public Event OnClose()

Private Sub Class_Initialize()
    Set mDlg = New dlgDemo
End Sub


Private Sub Class_Terminate()
    Unload mDlg
    Set mDlg = Nothing
End Sub

' Clear out the settings
Public Sub Clear()
Attribute Clear.VB_Description = "Sets ElementID, FirstName and LastName to empty strings."
    mDlg.txtFirstName = ""
    mDlg.txtLastName = ""
    mDlg.txtDemo.Text = ""
End Sub


Public Property Get ElemID() As String
Attribute ElemID.VB_Description = "A unique element ID.  Intended to be used as a key field to look up a record in a database. Actual database lookup is left as an exercise for the reader."
    ElemID = mDlg.txtDemo.Text
End Property
Public Property Get FirstName() As String
Attribute FirstName.VB_Description = "First Name.  ShowDialog() will allow the user to edit this."
    FirstName = mDlg.txtFirstName.Text
End Property
Public Property Get LastName() As String
Attribute LastName.VB_Description = "Last Name.   ShowDialog() will allow the user to edit this."
    LastName = mDlg.txtLastName.Text
End Property
Public Property Let ElemID(ByVal str As String)
    mDlg.txtDemo.Text = str
End Property
Public Property Let FirstName(ByVal str As String)
    mDlg.txtFirstName.Text = str
End Property
Public Property Let LastName(ByVal str As String)
    mDlg.txtLastName.Text = str
End Property


Public Sub ShowDialog()

   mDlg.Caption = "Owner Form"
   mDlg.Show vbModeless
 
End Sub

Public Sub HideDialog()
    mDlg.Hide
End Sub

Public Sub DoModal()
    With mDlg
        .Caption = "Test Form"
        .Show vbModal
    End With
End Sub

Private Sub mdlg_OnApply()
    RaiseEvent OnApply
End Sub

Private Sub mdlg_OnClose()
   RaiseEvent OnClose
End Sub

