📄 frmword.frm
字号:
VERSION 5.00
Object = "{00460180-9E5E-11D5-B7C8-B8269041DD57}#1.2#0"; "dsoframer.ocx"
Begin VB.Form frmWord
Caption = "详细信息"
ClientHeight = 6705
ClientLeft = 60
ClientTop = 180
ClientWidth = 10080
LinkTopic = "Form1"
ScaleHeight = 6705
ScaleWidth = 10080
StartUpPosition = 2 'CenterScreen
Visible = 0 'False
Begin VB.CommandButton Command3
Caption = "打印预览"
Height = 375
Left = 3960
TabIndex = 2
Top = 120
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "页面设置"
Height = 375
Left = 2160
TabIndex = 1
Top = 120
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "打 印 "
Height = 375
Left = 480
TabIndex = 0
Top = 120
Width = 1455
End
Begin DSOFramer.FramerControl FramerControl1
Height = 6015
Left = 240
TabIndex = 3
TabStop = 0 'False
Top = 600
Visible = 0 'False
Width = 9615
_ExtentX = 16960
_ExtentY = 10610
BorderColor = -2147483632
BackColor = -2147483643
ForeColor = -2147483640
TitlebarColor = -2147483635
TitlebarTextColor= -2147483634
BorderStyle = 3
Titlebar = 0 'False
Toolbars = 0 'False
Menubar = 0 'False
End
End
Attribute VB_Name = "frmWord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub FramerControl1_OnPrintPreviewExit()
' Re-enable menu items after preview.
Command1.Visible = True
Command2.Visible = True
Command3.Visible = True
FramerControl1.Close
Unload frmWord
End Sub
Private Sub Command1_Click()
On Error Resume Next
FramerControl1.PrintOut 1 '1代表先出现print设置的对话框
If Err.Number Then
MsgBox "Unable to print document." & vbCrLf & _
"(" & str(Err.Number) & "): " & Err.Description, _
vbCritical, "Error"
Err.Clear
End If
End Sub
Private Sub Command2_Click()
On Error Resume Next
FramerControl1.ShowDialog dsoDialogPageSetup
If Err.Number Then
MsgBox "Unable to show page setup." & vbCrLf & _
"(" & str(Err.Number) & "): " & Err.Description, _
vbCritical, "Error"
Err.Clear
End If
End Sub
Private Sub Command3_Click()
On Error Resume Next
Command1.Visible = False
Command2.Visible = False
Command3.Visible = False
FramerControl1.PrintPreview
If Err.Number Then
MsgBox "Unable to go into print preview." & vbCrLf & _
"(" & str(Err.Number) & "): " & Err.Description, _
vbCritical, "Error"
Err.Clear
End If
End Sub
Private Sub Form_Load()
On Error GoTo ErrHandler
If isAdmin = True Then
Const password = "123456"
Dim intcounter As Integer
Dim strpassword As String
For intcounter = 1 To 3
strpassword = InputBox("请输入管理员密码:", "输入密码")
If strpassword = password Then
FramerControl1.Open dataFile
FramerControl1.Menubar = True
FramerControl1.Toolbars = True
Command1.Enabled = False
Command1.Visible = False
Command2.Enabled = False
Command2.Visible = False
Command3.Enabled = False
Command3.Visible = False
Exit For
End If
Next intcounter
If intcounter > 3 Then
MsgBox "对不起!您是非管理员用户!档案将以只读形式打开", vbOKOnly + vbCritical, "警告"
frmMain.Check7.Value = 0
isAdmin = False
End If
ElseIf isAdmin = False Then
FramerControl1.Open dataFile
FramerControl1.Menubar = False
FramerControl1.Toolbars = False
FramerControl1.Titlebar = False
Command1.Visible = False
Command2.Visible = False
Command3.Visible = False
FramerControl1.PrintPreview
End If
Exit Sub
ErrHandler:
Select Case Err.Number
Case Else
Err.Clear
MsgBox "未知错误!"
Exit Sub
End Select
Resume
End Sub
Private Sub Form_Resize()
On Error Resume Next
' On resize, we scale the framer control to fit the form...
If (Me.ScaleWidth > 20) And (Me.ScaleHeight > 60) Then
FramerControl1.Move 10, 52, Me.ScaleWidth - 20, Me.ScaleHeight - 60
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -