main.bas

来自「关于VB模块的」· BAS 代码 · 共 62 行

BAS
62
字号
Attribute VB_Name = "basMain"

Option Explicit

'Application info for display in the Splash and About forms.
Public Const pcstrAppPlatform As String = "Win 95/98/NT4"

'API declaration used to ensure Splash screen stays on top.
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const GWL_HWNDPARENT = (-8)

Sub Main()
    
  
  On Error GoTo HandleErrors
      
  frmSplash.Platform = pcstrAppPlatform
  frmSplash.Show
  
  
  'Ensure the Splash form is refreshed prior to displaying the Main form.
  DoEvents
                
  '---------------------------------------------------------------------------------------------------------------------

  'Perform other start up tasks here...
      
  'For demo purposes we add a delay to simulate a typical applications initialisation.
  DemoDelay
  
  '---------------------------------------------------------------------------------------------------------------------
  
  frmMain.Show
  
  DoEvents
      
  Unload frmSplash

ExitHandleErrors:
  
  Exit Sub
  
HandleErrors:

  MsgBox Err.Description & " (" & Err.Number & ")", vbCritical, App.Title & " Error"
  Resume ExitHandleErrors

End Sub

Public Sub DemoDelay()

  
  On Error Resume Next
      
  Dim sngStartTime As Single
  sngStartTime = Timer
  Do Until (Timer - sngStartTime) > 4
      DoEvents
  Loop

End Sub

⌨️ 快捷键说明

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