⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 olertime.frm

📁 OLE的使用
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmOLE 
   Caption         =   "frmOLE"
   ClientHeight    =   3756
   ClientLeft      =   60
   ClientTop       =   348
   ClientWidth     =   5028
   LinkTopic       =   "Form1"
   ScaleHeight     =   3756
   ScaleWidth      =   5028
   StartUpPosition =   3  '窗口缺省
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   360
      Top             =   2880
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton CommandFileOpen 
      Caption         =   "打开文件..."
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   5
      Top             =   2040
      Width           =   1392
   End
   Begin VB.CommandButton CommandFileSaveAs 
      Caption         =   "另存..."
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   4
      Top             =   1560
      Width           =   1392
   End
   Begin VB.CommandButton CommandClose 
      Caption         =   "关闭"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   3
      Top             =   1080
      Width           =   1392
   End
   Begin VB.CommandButton CommandObjInfo 
      Caption         =   "对象信息"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   2
      Top             =   600
      Width           =   1392
   End
   Begin VB.CommandButton CommandInsObj 
      Caption         =   "插入对象"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.8
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   1392
   End
   Begin VB.OLE OLE1 
      Height          =   3375
      Left            =   1680
      TabIndex        =   0
      Top             =   120
      Width           =   3015
   End
End
Attribute VB_Name = "frmOLE"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public OLEHeight As Integer
Public OLEWidth As Integer

Private Sub CommandClose_Click()
    Dim Quit As String
    
    Quit = MsgBox("Are you sure you want to quit ?", vbYesNo + vbQuestion)
    If Quit = vbYes Then End
End Sub

Private Sub CommandFileOpen_Click()
    On Error GoTo Cancel
    CommonDialog1.ShowOpen                      'Show Open Dialog
    Open CommonDialog1.FileName For Input As #1 'Open File
    OLE1.ReadFromFile (1)                       'read File No.1
    Close #1                                    'Close File
Cancel:
End Sub

Private Sub CommandFileSaveAs_Click()
    On Error GoTo Cancel
    CommonDialog1.ShowSave                          'Show Save As Dialog
    Open CommonDialog1.FileName For Output As #1    'Open File
    OLE1.SaveToFile (1)                             'Write to File No.1
    Close #1                                        'Close File
Cancel:
End Sub

Private Sub CommandInsObj_Click()
    frmType.Show
End Sub


Private Sub CommandObjInfo_Click()
    Dim SourceText As String, TypeText As String
    Dim ItemText As String, MsgText As String
    
    SourceText = "The Object's source files is " & OLE1.SourceDoc
    TypeText = "The Type of object is " & OLE1.Class
    ItemText = "The selected item is " & OLE1.SourceItem
    MsgText = SourceText & vbCrLf & TypeText & ItemText
    MsgBox MsgText, vbInformation, "Object Information"
End Sub


Private Sub Form_Load()
OLEHeight = OLE1.Height
OLEWidth = OLE1.Width
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -