?? frmmain.frm
字號:
End
Begin VB.Menu z1
Caption = "-"
End
Begin VB.Menu mnucontrolexit
Caption = "退出(&X)"
Shortcut = ^Q
End
End
Begin VB.Menu mnuView
Caption = "視圖(&V)"
Begin VB.Menu mnuViewToolbar
Caption = "工具欄(&T)"
Checked = -1 'True
End
Begin VB.Menu mnuViewStatusBar
Caption = "狀態欄(&B)"
Checked = -1 'True
End
Begin VB.Menu fgs
Caption = "-"
End
Begin VB.Menu skin1
Caption = "皮膚"
Begin VB.Menu formskin
Caption = "寶石藍"
Index = 0
End
Begin VB.Menu formskin
Caption = "青草綠"
Index = 1
End
Begin VB.Menu formskin
Caption = "紫水晶"
Index = 2
End
Begin VB.Menu formskin
Caption = "火玫瑰"
Index = 3
End
Begin VB.Menu formskin
Caption = "大蝦青"
Index = 4
End
End
Begin VB.Menu fg21
Caption = "-"
End
Begin VB.Menu mnuclose
Caption = "關閉(&E)"
Shortcut = ^E
End
End
Begin VB.Menu mnuwh
Caption = "試題庫維護(&W)"
Begin VB.Menu mnubackup
Caption = "備份數據庫"
Shortcut = ^B
End
Begin VB.Menu fg
Caption = "-"
End
Begin VB.Menu mnutk
Caption = "填空題(&F)"
Shortcut = ^F
End
Begin VB.Menu mnuxz
Caption = "選擇題(&C)"
Shortcut = ^C
End
Begin VB.Menu mnujd
Caption = "簡答題(&J)"
Shortcut = ^J
End
Begin VB.Menu fg3
Caption = "-"
End
Begin VB.Menu mnuscsj
Caption = "生成試卷(&S)"
Shortcut = ^S
End
End
Begin VB.Menu mnuHelp
Caption = "幫助(&H)"
Begin VB.Menu mnuHelpContents
Caption = "主題(&C)"
End
Begin VB.Menu mnuHelpBar0
Caption = "-"
End
Begin VB.Menu mnuHelpAbout
Caption = "關于(&A) "
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function DeleteFile Lib "kernel32" Alias "DeleteFileA" (ByVal lpFileName As String) As Long
Private Declare Function HtmlHelpA Lib "hhctrl.ocx" (ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long
Const HH_DISPLAY_TOPIC = &H0
Const HH_DISPLAY_INDEX = &H2
Const HH_HELP_CONTEXT = &HF
Const HH_DISPLAY_SEARCH = &H3
Const HH_DISPLAY_TEXT_POPUP = &HE
Private m_cN1 As cNeoCaption
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long
Const EM_UNDO = &HC7
Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
Private Sub formskin_Click(Index As Integer)
picname = App.Path + "\ico\skin\" + formskin(Index).Caption + ".gif"
picbname = App.Path + "\ico\skin\" + formskin(Index).Caption + "2.gif"
PicCaption.Picture = LoadPicture(picname)
PicBorder.Picture = LoadPicture(picbname)
Skin Me, m_cN1
End Sub
Private Sub MDIForm_Activate()
If hmessage Then
frmTip.Show
End If
End Sub
Private Sub MDIForm_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\SHIJUAN.MDB;Persist Security Info=False"
Adodc1.RecordSource = "yxuanze1"
Adodc1.Refresh
Set m_cN1 = New cNeoCaption
Skin Me, m_cN1
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
mnucontrolexit_Click
If tuichu <> 6 Then
Cancel = 1
End If
End Sub
Private Sub mnubackup_Click()
Dim ss As Long
With dlgCommonDialog
Dim sFile, dfile As String
.DialogTitle = "另存為"
.CancelError = False
.Filter = "所有文件 (*.*)|*.*"
.ShowSave
If Len(.FileName) = 0 Then
Exit Sub
End If
sFile = .FileName
dfile = App.Path & "\data\kaoti.mdb"
End With
ss = CopyFile(dfile, sFile, 2)
If ss <> 0 Then
MsgBox "數據庫備份失敗,請重試!", vbExclamation, "錯誤"
Else
MsgBox "數據庫備份成功!", vbInformation, "成功"
End If
End Sub
Private Sub mnuclose_Click()
If Screen.ActiveForm.Caption <> "VB試題庫" Then
Unload Screen.ActiveForm
End If
End Sub
Public Sub mnucontrolexit_Click()
tuichu = MsgBox("確定退出么?", vbYesNo + vbQuestion, "退出?")
If tuichu = 6 Then
For i = 1 To 12
biao = "yxuanze" + Trim(Str(i))
Adodc1.RecordSource = biao
Adodc1.Refresh
While Adodc1.Recordset.RecordCount <> 0
Adodc1.Recordset.Delete (adAffectCurrent)
Adodc1.Recordset.Update
Adodc1.Refresh
Wend
biao = "zaixuanze" + Trim(Str(i))
Adodc1.RecordSource = biao
Adodc1.Refresh
While Adodc1.Recordset.RecordCount <> 0
Adodc1.Recordset.Delete (adAffectCurrent)
Adodc1.Recordset.Update
Adodc1.Refresh
Wend
Next i
Unload frmtiankong
Unload frmxuanze
Unload frmjianda
Unload Frmkaojuan
Unload frmTip
Unload frmmnu
Unload frmmnlx
Unload frmLogin
Unload fMainForm
'End
End If
End Sub
Private Sub mnuControlrelogin_Click()
Me.Hide
frmLogin.Show
End Sub
Private Sub mnuControltip_Click()
frmTip.Show
End Sub
Private Sub mnujd_Click()
'frmc.Visible = True
frmjianda.Show
End Sub
Private Sub mnumn_Click()
Me.Hide
frmmnlx.Show
End Sub
Private Sub mnuscsj_Click()
'frmd.Visible = True
Frmkaojuan.Show
End Sub
Private Sub mnutk_Click()
'frma.Visible = True
frmtiankong.Show
End Sub
Private Sub mnuxz_Click()
'frmb.Visible = True
frmxuanze.Show
End Sub
Private Sub tbToolBar_ButtonClick(ByVal Button As MSComCtlLib.Button)
On Error Resume Next
Select Case Button.Key
Case "tbmrts"
mnuControltip_Click
Case "tbcxdl"
mnuControlrelogin_Click
Case "beifen"
mnubackup_Click
Case "toolcs"
mnumn_Click
Case "toolsj"
mnuscsj_Click
Case "toolexit"
mnucontrolexit_Click
End Select
End Sub
Private Sub mnuHelpAbout_Click()
MsgBox "版本 " & App.Major & "." & App.Minor & "." & App.Revision
End Sub
Private Sub mnuHelpContents_Click()
If Dir(App.Path & "\data\help.chm") = "" Then
MsgBox "幫助文件:" + App.Path & "\data\help.chm 未找到無法顯示幫助主題", vbInformation, Me.Caption
Else
'On Error Resume Next
HtmlHelpA fMainForm.hwnd, App.Path & "\data\help.CHM", 0, 0
If Err Then
MsgBox Err.Description
End If
End If
End Sub
Private Sub mnuViewStatusBar_Click()
mnuViewStatusBar.Checked = Not mnuViewStatusBar.Checked
sbStatusBar.Visible = mnuViewStatusBar.Checked
End Sub
Private Sub mnuViewToolbar_Click()
mnuViewToolbar.Checked = Not mnuViewToolbar.Checked
tbToolBar.Visible = mnuViewToolbar.Checked
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -