home *** CD-ROM | disk | FTP | other *** search
- Type InheritanceForm From SampleMasterForm
- Dim BtnCopyForm As New Button
- Dim BtnDeleteForm As New Button
- Dim Label1 As New Label
- Dim Label2 As New Label
- Dim Label3 As New Label
- Dim Label4 As New Label
- Dim Label5 As New Label
- Dim Label6 As New Label
- Dim Label7 As New Label
- Dim Label8 As New Label
- Dim Label9 As New Label
- Dim Label10 As New Label
-
- ' METHODS for object: InheritanceForm
- Sub BtnCopyForm_Click()
- Dim unique_name As String
- Dim new_form As Object
-
- unique_name = UniqueObjectName(InheritanceForm)
- new_form = CopyObject(InheritanceForm, unique_name)
-
- new_form.Show
- new_form.Move Left + (Width / 10), Top + (Height / 10), Width, Height
- new_form.Caption = unique_name & " (Child)"
-
- End Sub
-
- Sub BtnDeleteForm_Click()
- ' If the form is a copy of InheritanceForm, then destroy it
- If Me = InheritanceForm Then
- ' Do nothing
- Else
- DestroyObject(Me)
- End If
- End Sub
-
- Sub Load
- SetSampleDir
- InitHelpFile
- If Me <> SampleMasterForm Then Show
- End Sub
-
- Sub ResetApplication_Click
- ' Remove a child form if it exists
- If FindObject("InheritanceForm1") Then
- DestroyObject(InheritanceForm1)
- End If
- ' Remove any buttons that may be left on the form
- If FindObject("InheritanceForm.Button1") Then
- DestroyObject(InheritanceForm.Button1)
- End If
- If FindObject("InheritanceForm.Button2") Then
- DestroyObject(InheritanceForm.Button2)
- End If
- If FindObject("InheritanceForm.Button3") Then
- DestroyObject(InheritanceForm.Button3)
- End If
-
- End Sub
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: InheritanceForm
- '
- With InheritanceForm
- .Caption := "Inheritance Example (Parent)"
- .Move(4320, 3915, 6765, 5490)
- .SampleDir := "W:\bootcamp\concepts\inherit\"
- .SampleName := "inherit"
- With .BtnCopyForm
- .Caption := "Copy Form"
- .ZOrder := 1
- .Move(150, 4200, 1350, 450)
- End With 'InheritanceForm.BtnCopyForm
- With .BtnDeleteForm
- .Caption := "Delete Child"
- .ZOrder := 2
- .Move(4950, 4200, 1500, 450)
- End With 'InheritanceForm.BtnDeleteForm
- With .Label1
- .Caption := "A. Click the Copy Form button on Parent to create Child form."
- .ForeColor := 16711680
- .ZOrder := 3
- .Move(600, 450, 5850, 300)
- End With 'InheritanceForm.Label1
- With .Label2
- .Caption := "B. Add a button located here on Parent. ->"
- .ForeColor := 16711680
- .ZOrder := 4
- .Move(600, 1200, 4200, 300)
- End With 'InheritanceForm.Label2
- With .Label3
- .Caption := "C. Move the button down here on Parent. ->"
- .ForeColor := 16711680
- .ZOrder := 5
- .Move(600, 1800, 4350, 300)
- End With 'InheritanceForm.Label3
- With .Label4
- .Caption := "D. Add a button located here on Child. ->"
- .ForeColor := 255
- .ZOrder := 6
- .Move(600, 2550, 4350, 300)
- End With 'InheritanceForm.Label4
- With .Label5
- .Caption := "E. Add a button located here on Parent. ->"
- .ForeColor := 16711680
- .ZOrder := 7
- .Move(600, 3300, 4200, 300)
- End With 'InheritanceForm.Label5
- With .Label6
- .Caption := "1. Disable Form Editor on Parent form."
- .ZOrder := 8
- .Move(300, 150, 3750, 300)
- End With 'InheritanceForm.Label6
- With .Label7
- .Caption := "2. Enable Form Editor on Parent."
- .ZOrder := 9
- .Move(300, 900, 3150, 300)
- End With 'InheritanceForm.Label7
- With .Label8
- .Caption := "5. Click the 'Delete Child' button on Child form."
- .ZOrder := 10
- .Move(300, 3750, 4500, 300)
- End With 'InheritanceForm.Label8
- With .Label9
- .Caption := "3. Enable Form Editor on Child."
- .ZOrder := 11
- .Move(300, 2250, 3150, 300)
- End With 'InheritanceForm.Label9
- With .Label10
- .Caption := "4. Enable Form Editor on Parent."
- .ZOrder := 12
- .Move(300, 3000, 3150, 300)
- End With 'InheritanceForm.Label10
- With .helpfile
- .FileName := "W:\bootcamp\concepts\inherit\inherit.hlp"
- End With 'InheritanceForm.helpfile
- End With 'InheritanceForm
- End Code
-