home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / PGUIDE / OLECONT / CONTCHLD.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1997-01-20  |  5.2 KB  |  208 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Begin VB.Form ChildForm 
  4.    AutoRedraw      =   -1  'True
  5.    Caption         =   "OLE 
  6.    ClientHeight    =   3330
  7.    ClientLeft      =   1140
  8.    ClientTop       =   3735
  9.    ClientWidth     =   5550
  10.    LinkTopic       =   "Form1"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   3330
  13.    ScaleWidth      =   5550
  14.    Begin MSComDlg.CommonDialog CommonDialog1 
  15.       Left            =   360
  16.       Top             =   360
  17.       _ExtentX        =   847
  18.       _ExtentY        =   847
  19.       FontSize        =   8.49966e-19
  20.    End
  21.    Begin VB.OLE OLE1 
  22.       Height          =   3252
  23.       Left            =   0
  24.       TabIndex        =   0
  25.       Top             =   0
  26.       Width           =   5532
  27.    End
  28.    Begin VB.Menu mnuFile 
  29.       Caption         =   "
  30. (&F)"
  31.       NegotiatePosition=   1  'Left
  32.       Begin VB.Menu mnuFileNew 
  33.          Caption         =   "
  34. (&N)..."
  35.       End
  36.       Begin VB.Menu mnuSave 
  37.          Caption         =   "
  38. (&S)..."
  39.       End
  40.       Begin VB.Menu mnuOpen 
  41.          Caption         =   "
  42. (&O)"
  43.       End
  44.       Begin VB.Menu sep1 
  45.          Caption         =   "-"
  46.       End
  47.       Begin VB.Menu mnuExit 
  48.          Caption         =   "
  49. (&X)"
  50.       End
  51.       Begin VB.Menu sep2 
  52.          Caption         =   "-"
  53.       End
  54.       Begin VB.Menu mnuAbout 
  55.          Caption         =   "
  56. (&B)..."
  57.       End
  58.    End
  59.    Begin VB.Menu mnuEdit 
  60.       Caption         =   "
  61. (&E)"
  62.       Begin VB.Menu mnuCopy 
  63.          Caption         =   "
  64. (&C)"
  65.       End
  66.       Begin VB.Menu mnuDelete 
  67.          Caption         =   "
  68. (&D)"
  69.       End
  70.       Begin VB.Menu mnuSpecial 
  71.          Caption         =   "
  72. (&S)..."
  73.       End
  74.       Begin VB.Menu esep2 
  75.          Caption         =   "-"
  76.       End
  77.       Begin VB.Menu mnuUpdate 
  78.          Caption         =   "
  79. (&U)"
  80.       End
  81.    End
  82.    Begin VB.Menu mnuCloseOLE 
  83.       Caption         =   "
  84.  Ole 
  85. (&C)"
  86.       NegotiatePosition=   3  'Right
  87.    End
  88.    Begin VB.Menu mnuWindow 
  89.       Caption         =   "
  90. (&W)"
  91.       WindowList      =   -1  'True
  92.       Begin VB.Menu mnuCascade 
  93.          Caption         =   "
  94. (&C)"
  95.       End
  96.       Begin VB.Menu mnuTile 
  97.          Caption         =   "
  98. (&T)"
  99.       End
  100.       Begin VB.Menu mnuArrange 
  101.          Caption         =   "
  102. (&A)"
  103.       End
  104.    End
  105. Attribute VB_Name = "ChildForm"
  106. Attribute VB_GlobalNameSpace = False
  107. Attribute VB_Creatable = False
  108. Attribute VB_PredeclaredId = True
  109. Attribute VB_Exposed = False
  110. Option Explicit
  111. Private Sub Form_Load()
  112. On Error Resume Next
  113.     OLE1.Move 0, 0
  114.     OLE1.Height = Me.Height
  115.     OLE1.Width = Me.Width
  116.           
  117.     OLE1.HostName = "OLE 
  118. End Sub
  119. Private Sub mnuAbout_Click()
  120.     DisplayInstructions
  121. End Sub
  122. Private Sub mnuArrange_Click()
  123.     ParentForm.Arrange vbArrangeIcons
  124. End Sub
  125. Private Sub mnuCascade_Click()
  126.     ParentForm.Arrange vbCascade
  127. End Sub
  128. Private Sub mnuClose_Click()
  129.     ' 
  130.  OLE 
  131.     OLE1.Close
  132. End Sub
  133. Private Sub mnuCloseOLE_Click()
  134.     OLE1.Close
  135. End Sub
  136. Private Sub mnuCopy_Click()
  137.     If OLE1.AppIsRunning = True Then
  138.         OLE1.Copy
  139.     Else
  140.         OLE1.AppIsRunning = True
  141.         If OLE1.AppIsRunning Then OLE1.Copy
  142.     End If
  143.     If OLE1.OLEType <> vbOLENone Then   ' 
  144.         ' 
  145.         Screen.MousePointer = 11
  146.         If OLE1.AppIsRunning Then
  147.            OLE1.Copy                    ' 
  148.         End If
  149.     End If
  150.     Screen.MousePointer = 0
  151. End Sub
  152. Private Sub mnuDelete_Click()
  153.     If OLE1.OLEType <> vbOLENone Then   ' 
  154.         OLE1.Delete                     ' 
  155.     End If
  156.         Unload Me
  157. End Sub
  158. Private Sub mnuEdit_Click()
  159.     On Error Resume Next
  160.     If Err Then
  161.         MsgBox "
  162.     End If
  163.     If OLE1.PasteOK Then
  164.         ParentForm.ActiveForm.mnuSpecial.Enabled = True
  165.     Else
  166.         ParentForm.ActiveForm.mnuSpecial.Enabled = False
  167.     End If
  168. End Sub
  169. Private Sub mnuExit_Click()
  170.     End
  171. End Sub
  172. Private Sub mnuFileNew_Click()
  173.     NewObject
  174. End Sub
  175. Private Sub mnuOpen_Click()
  176.     OpenObject
  177. End Sub
  178. Private Sub mnuSave_Click()
  179.     OpenSave ("Save")
  180. End Sub
  181. Private Sub mnuSpecial_Click()
  182.     If OLE1.PasteOK Then
  183.         MDINew = False
  184.         OLE1.PasteSpecialDlg
  185.         Screen.MousePointer = 11
  186.         UpdateCaption
  187.         Screen.MousePointer = 0
  188.     End If
  189. End Sub
  190. Private Sub mnuTile_Click()
  191.     ParentForm.Arrange vbTileHorizontal
  192. End Sub
  193. Private Sub mnuUpdate_Click()
  194.     Screen.MousePointer = 11
  195.     OLE1.Update
  196.     Screen.MousePointer = 0
  197. End Sub
  198. Private Sub Ole1_ObjectMove(Left As Single, Top As Single, Width As Single, Height As Single)
  199.     OLE1.Move OLE1.Left, OLE1.Top, Width, Height
  200.     OLE1.Move Left, Top, OLE1.Width, OLE1.Height
  201. End Sub
  202. Private Sub OLE1_Resize(HeightNew As Single, WidthNew As Single)
  203.     OLE1.SizeMode = vbOLESizeAutoSize
  204. End Sub
  205. Private Sub Ole1_Updated(Code As Integer)
  206.     OLE1.SizeMode = vbOLESizeAutoSize
  207. End Sub
  208.