home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 4512
- ClientLeft = 2760
- ClientTop = 2388
- ClientWidth = 7740
- Height = 5064
- Left = 2712
- LinkTopic = "Form1"
- ScaleHeight = 4512
- ScaleWidth = 7740
- Top = 1884
- Width = 7836
- Begin VB.PictureBox Picture1
- Height = 4572
- Left = 0
- ScaleHeight = 4524
- ScaleWidth = 7764
- TabIndex = 1
- Top = 0
- Width = 7812
- End
- Begin VB.OLE OLE1
- Height = 4572
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 7692
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- NegotiatePosition= 1 'Left
- Begin VB.Menu mnuNew
- Caption = "&New Object"
- End
- Begin VB.Menu mnuClose
- Caption = "&Close Object"
- End
- Begin VB.Menu mnuSep1
- Caption = "-"
- End
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuPopup
- Caption = ""
- Begin VB.Menu mnuEdit
- Caption = "&Edit"
- End
- Begin VB.Menu mnuOpen
- Caption = "&Open"
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Form_Load()
- ' Use the automatic size mode to get
- ' the best picture of the whole object.
- OLE1.SizeMode = vbOLESizeAutoSize
- OLE1.InsertObjDlg
- End Sub
- Private Sub Form_Resize()
- ' Keep controls form-sized.
- picture1.Height = Me.ScaleHeight
- picture1.Width = Me.ScaleWidth
- OLE1.Height = Me.ScaleHeight
- OLE1.Width = Me.ScaleWidth
- End Sub
- Private Sub mnuClose_Click()
- picture1.picture = OLE1.picture
- OLE1.Close
- OLE1.Visible = False
- picture1.Visible = True
- End Sub
- Private Sub mnuEdit_Click()
- OLE1.Height = picture1.Height
- OLE1.Width = picture1.Width
- OLE1.Visible = True
- picture1.Visible = False
- OLE1.DoVerb -5
- End Sub
- Private Sub mnuExit_Click()
- End
- End Sub
- Private Sub mnuNew_Click()
- OLE1.Visible = True
- picture1.Visible = False
- OLE1.InsertObjDlg
- End Sub
- Private Sub mnuOpen_Click()
- OLE1.Height = picture1.Height
- OLE1.Width = picture1.Width
- OLE1.Visible = True
- picture1.Visible = False
- OLE1.DoVerb -2
- End Sub
- Private Sub OLE1_Updated(Code As Integer)
- Select Case Code
- Case vbOLEChanged
- ' Make sure application is running
- ' (required for next step).
- OLE1.AppIsRunning = True
- ' Capture the image of the control.
- picture1.picture = OLE1.picture
- Case vbOLEClosed
- ' Show the picture box instead of
- ' the OLE control.
- picture1.Visible = True
- OLE1.Visible = False
- Case Else
- ' Do nothing.
- End Select
- End Sub
- Private Sub picture1_Click()
- Me.PopupMenu mnuPopup, , , , mnuEdit
- End Sub
-