module1.bas
来自「职工信息系统」· BAS 代码 · 共 50 行
BAS
50 行
Attribute VB_Name = "Module1"
Public fMainForm As frmMain
'-------------------------------
'使窗体始终保持在最前面
Public MainShowed As Boolean
Public Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Public CurrentFile As String
Public Function PutWindowOnTop(pFrm As Form)
Dim lngWindowPosition As Long
lngWindowPosition = SetWindowPos(pFrm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Function
Sub Main()
Dim timeout As Variant
frmSplash.Show
Set fMainForm = New frmMain
timeout = Timer + 1
While Timer < timeout
DoEvents
Wend
Load fMainForm
fMainForm.Show
MainShowed = True
End Sub
Public Sub ShowHelp()
Dim ChmFilePath As String
If Dir(ChmFilePath) <> "" Then
ChmFilePath = App.Path & "\软件帮助说明.CHM"
ShellExecute 0, vbNullString, ChmFilePath, vbNullString, vbNullString, vbNormalFocus
Else
MsgBox "帮助文档没有找到!", vbInformation, "提示"
End If
End Sub
Public Sub NewDataBase(DataPath As String)
Dim db As Database
Dim rs As Recordset
Set db = CreateDatabase(DataPath, dbLangGeneral, dbVersion70)
db.Execute "CREATE TABLE [职工信息]([职工编号] TEXT(10),[姓名] TEXT(10),[性别] TEXT(2),[出生年月] DATETIME,[职称] TEXT(10),[最后学历] TEXT(10),[工资] CURRENCY,[婚否] TEXT(2));"
db.Close
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?