dynamicmdi.bas

来自「VB圣经」· BAS 代码 · 共 38 行

BAS
38
字号
Attribute VB_Name = "modMain"
'***************************************************************
' (c) Copyright 2000 Matthew J. Curland
'
' This file is from the CD-ROM accompanying the book:
' Advanced Visual Basic 6: Power Techniques for Everyday Programs
'   Author: Matthew Curland
'   Published by: Addison-Wesley, July 2000
'   ISBN: 0-201-70712-8
'   http://www.PowerVB.com
'***************************************************************
Option Explicit
Public Const strCLSID_APPCONTEXT As String = "{325FBD60-35EC-11D4-91FE-D41203C10000}"

Sub Main()
    InitVBoost
    MDIFormMain.Show
End Sub

Public Function ShowNewForm(FullOcxPath As String, ControlOrCLSID As String, Optional RTLicenseKey As String) As Object
Dim NewForm As New frmDynamic
    'Allow an existing form to show a new form
    With g_OcxTargetData
        If AscW(ControlOrCLSID) = 123 Then '123 = {, assume this is a guid
            .CLSID = GUIDFromString(ControlOrCLSID)
        Else
            .CLSID = CLSIDFromFileAndClassName(FullOcxPath, ControlOrCLSID)
        End If
        .RTLicenseKey = RTLicenseKey
        .TargetOcx = FullOcxPath
        .fTargetAbsolute = True
    End With
    NewForm.Show
    Set ShowNewForm = NewForm.ctlDynamic.object
End Function


⌨️ 快捷键说明

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